coap-rs
coap-rs copied to clipboard
Message IDs and tokens not set
When used as a CoAP client, the token is always empty, and the message ID is not set.
This does not cause practical problems as long as they are sent from per-request sockets (as they are in the client example), but if multiple requests are sent to the same client, for example as in
let mut client = CoAPClient::new("localhost:5683").unwrap();
client.request_path("/time", coap_lite::RequestType::Get, None, None).unwrap();
client.request_path("/location", coap_lite::RequestType::Get, None, None).unwrap();
then a CoAP server that does request deduplication will respond to the second request with the time of the first request, rather than with its location.
(CC @malishav with whom I encountered this).
Currently the token and message id still need the user set manually. I will build a new method to implement it later.
https://github.com/Covertness/coap-rs/commit/817c0a666bc790b5fd2b101eb494827584dd1823