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

Unmatched incoming response problem #154

Open
Dalanke opened this issue Nov 3, 2019 · 0 comments
Open

Unmatched incoming response problem #154

Dalanke opened this issue Nov 3, 2019 · 0 comments

Comments

@Dalanke
Copy link

Dalanke commented Nov 3, 2019

This problem is for CoAP client, when client use domain as server host, it will cause unmatched incoming response problem.
For example, when test in local:

from coapthon.client.helperclient import HelperClient

client = HelperClient(('localhost', 5683))
respones=client.get('temp')

the log output:
2019-11-03 01:02:17,459:WARNING:Un-Matched incoming response message 127.0.0.1:5683

if change localhost to 127.0.0.1, there is no issue.

I find out that problem is the hash function take host and port as parameters, when you send request, you take 'localhost' as host to compute hash, when you receive the response, you take '127.0.0.1' as host to compute again. Of course is different and unmatched.

This issue can be addressed by directly converting input server(domain, port) to (ip, port)
I have made a pull request to this issue and also add ping function into HelperClient, hope it works, thank you.

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

No branches or pull requests

1 participant