coap-rs icon indicating copy to clipboard operation
coap-rs copied to clipboard

Message IDs and tokens not set

Open chrysn opened this issue 2 years ago • 1 comments

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).

chrysn avatar Jul 24 '22 21:07 chrysn

Currently the token and message id still need the user set manually. I will build a new method to implement it later.

Covertness avatar Jul 28 '22 12:07 Covertness

https://github.com/Covertness/coap-rs/commit/817c0a666bc790b5fd2b101eb494827584dd1823

Covertness avatar Sep 10 '22 07:09 Covertness