Closed TerryLiu closed 3 years ago
I'm not a flutter user, I use Dart only in the VM or the web so I don't know how to do do as you request for continuous reception of data. The flutter example was contributed by @pedromassango not me, I suggest you either contact him or ask on a flutter list.
From the spec RFC7252 -
5.2.1 Piggybacked
In the most basic case, the response is carried directly in the
Acknowledgement message that acknowledges the request (which requires
that the request was carried in a Confirmable message). This is
called a "Piggybacked Response".
The response is returned in the Acknowledgement message, independent
of whether the response indicates success or failure. In effect, the
response is piggybacked on the Acknowledgement message, and no
separate message is required to return the response.
Implementation Note: The protocol leaves the decision whether to
piggyback a response or not (i.e., send a separate response) to
the server. The client MUST be prepared to receive either. On
the quality-of-implementation level, there is a strong expectation
that servers will implement code to piggyback whenever possible --
saving resources in the network and both at the client and at the
server.
If you want to piggy back you should use confirmable requests, in fact your server shouldn't send an ack with a piggy back if the request is not confirmable, it should use a separate response, see 5.2.2 of the spec.
OK, Thank you @shamblett .
@pedromassango Could you see this issue?
Hi, It has been some time since I worked with CoAP.
I think you should call markObserve()
and then listen to the responses
stream in the same request, then you should get new responses once the server sends it.
Hope this helps
Hi, It has been some time since I worked with CoAP.
I think you should call
markObserve()
and then listen to theresponses
stream in the same request, then you should get new responses once the server sends it.Hope this helps
Thank you @pedromassango . I'm trying do it. At the same time, new problem were pops out #24
Hi, @shamblett I was caught in a new difficulty that
How to receive data continuously
. The Flutter app's Loading State is always in a waiting state when a coap server send msg in it.The Flutter App's code is example\flutter\lib\main.dart:
**1. Is there a way to continuously receive the data?
WARNING: >> Matcher - Ignoring unmatchable piggy-backed response
?**Please help me.
The log see: