Skip to content

Commit

Permalink
fix: fix subscription implementation for CoAP
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed May 30, 2022
1 parent a381f7d commit 58f80c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/src/binding_coap/coap_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -582,12 +582,16 @@ class _CoapSubscription implements Subscription {

@override
Future<void> stop([InteractionOptions? options]) async {
if (!_active) {
return;
}
_active = false;

final observeClientRelation = _observeClientRelation;
if (observeClientRelation != null) {
await _coapClient.cancelObserveProactive(observeClientRelation);
}
_coapClient.close();
_active = false;
_complete();
}
}

0 comments on commit 58f80c4

Please sign in to comment.