Skip to content

Commit

Permalink
feat(coap): let _discoverFromUnicast return a Stream
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jul 10, 2022
1 parent 4db8db5 commit fa1656f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/binding_coap/coap_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -368,16 +368,16 @@ class CoapClient extends ProtocolClient {
yield* streamController.stream;
}

Future<ThingDescription> _discoverFromUnicast(
Stream<ThingDescription> _discoverFromUnicast(
coap.CoapClient client,
Uri uri,
) async {
) async* {
final response = await client.get(
uri.path,
accept: coap.CoapMediaType.applicationTdJson,
);
client.close();
return _handleDiscoveryResponse(response, uri);
yield _handleDiscoveryResponse(response, uri);
}

@override
Expand All @@ -393,7 +393,7 @@ class CoapClient extends ProtocolClient {
yield* _discoverFromMulticast(client, uri);
}
} else {
yield await _discoverFromUnicast(client, uri);
yield* _discoverFromUnicast(client, uri);
}
}

Expand Down

0 comments on commit fa1656f

Please sign in to comment.