coap icon indicating copy to clipboard operation
coap copied to clipboard

Unconfirmable message

Open vasilakisfil opened this issue 9 years ago • 1 comments

Is it possible to send an unconfirmable message? Also do you know if sending a confirmable message is blocking? (meaning that the client waits until it gets an ACK).

vasilakisfil avatar Feb 26 '16 14:02 vasilakisfil

First, please note that the code from the fork (at nning/coap) is online as coap gem since version 0.1.0.

Sending an unconfirmable message is possible with the following snippet, for example:

client.get_by_uri('coap://[::1]/hello', nil, tt: :non)

Currently, both sending confirmable and non-confirmable messages blocks the program flow and the method call returns the answer as CoAP::Message directly. The initial receive timeout is 2 seconds. For non-confirmable messages, a Timeout::Error Exception is thrown after this timeout. Confirmable messages are resent with increasing timeouts (4 times by default).

It is currently not possible to prevent blocking until an answer has been received but this would be an interesting feature.

nning avatar Feb 26 '16 15:02 nning