shamblett / coap

A Coap package for dart
Other
16 stars 13 forks source link

Response not received on second request #54

Closed chetan87-kamble closed 1 year ago

chetan87-kamble commented 2 years ago

Hi,

Greetings!

I am using CoAP 3.4.0 library in my sample application. I used your given example of Hello World. After run the project on device, I managed to receive response first time. On second request it get timed out after retrying.

Please suggest me, if I am doing anything wrong.

Here I'm attached my sample code file and response file main.txt responses.txt

Thank you, Chetan

shamblett commented 2 years ago

All the log is showing is that the server is not responding, the only way to find this out is to look at the logs on the server and see what it thinks is happening. The only other thing I can see is that you close the client between calls, this is really only meant to be used when you have finished you session with the server, once you have initialised the client you can keep using it with new get requests, there's no need to close it and re initialise it every time.

chetan87-kamble commented 2 years ago

Hi Steve! Greetings!

Thank you for your suggestions. I tried with such code. In that case, communication with first server is OK. When I tried to send command to second server then it is not worked. Request get timed out. Can you please tell me the example, how to send CoAP request to two servers.

Thank you, Chetan

shamblett commented 2 years ago

Sorry I'm a bit confused, your code only shows one server(coap.me), not two, I thought you were trying to send two requests to the same server. If you are using two servers you need create a client for that server so you would need one for coap.me and one for your other server(don't use coap.me, use a different server).

shamblett commented 1 year ago

Believe this has been addressed. Package re released at version 5.0.0.