Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message IDs and tokens not set #79

Closed
chrysn opened this issue Jul 24, 2022 · 2 comments
Closed

Message IDs and tokens not set #79

chrysn opened this issue Jul 24, 2022 · 2 comments

Comments

@chrysn
Copy link
Contributor

chrysn commented Jul 24, 2022

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

@Covertness
Copy link
Owner

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

@Covertness
Copy link
Owner

817c0a6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants