Skip to content

Commit

Permalink
fixup! feat: add example for sendMulticast method
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Oct 10, 2022
1 parent b6f317e commit 6e850d1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions example/get_resource_multicast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@

import 'dart:async';
import 'package:coap/coap.dart';
import 'config/coap_config.dart';

FutureOr<void> main() async {
final conf = CoapConfig();
final uri = Uri(
scheme: 'coap',
host: CoapDefinedAddress.allCOAPNodesLinkLocalIPV6,
port: conf.defaultPort,
host: CoapDefinedAddress.allNodesIPV6,
);
final client = CoapClient(uri, conf);
final client = CoapClient(uri);

try {
final request = CoapRequest.newGet()..uriPath = './well-known/core';
final request = CoapRequest.newGet()..uriPath = '/.well-known/core';

await for (final response in client.sendMulticast(request)) {
print(response.payloadString);
Expand Down

0 comments on commit 6e850d1

Please sign in to comment.