-
Notifications
You must be signed in to change notification settings - Fork 8
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
x-nucleo-idw01m1: UDP socket recvfrom doesn't block #12
Comments
Could you pls. specify which version of the driver you are using? |
I have tested with driver versions 1.1.7 and 1.1.6, the result is the same. |
Thanks for reporting this. |
Ciao @juhaylinen, |
UDP sockets are not connected. After the socket is opened, it should just work. You should be able to have UDP socket which you never read from. Only receive. Or you should be able to have socket which you never sendto. It is perfectly fine with the protocol, but not always fine with AT-command set which are mostly written only TCP in mind. I'm not sure if this is the case with IDW01 |
Ciao @SeppoTakalo, P.S.: pls. note that I am not talking about POSIX but only about what mbed specifies! |
I still cannot see how this causes confusion, there is no mention about any precondition that should happen before the call.
Only precondition that have ever been mentioned is this:
So, as long as socket is opened, you can call Also, knowing what POSIX defines helps, because we try to follow the same behaviour, even that the API is a bit different. That is the only acceptable standard covering Sockets (IEEE Std 1003.1). |
After some testing, the issues seems to be resolved. Thanks for the fix. |
I have a test that sends UDP packets to echo server and reads incoming packets back. Incoming packets are received in a separate thread.
When socket is set to blocking mode,
it seems that recvfrom() call doesn't block and returns 0 several times before the packet is received. Similar behaviour is seen when socket is set to non-blocking mode. Instead of returning NSAPI_ERROR_WOULD_BLOCK, recvfrom() call returns 0 several times.
Board: NUCLEO_F401RE
Shield: IDW01M1
Compiler: GCC_ARM
Steps to reproduce
Create
main.cpp
Build&Run.
The text was updated successfully, but these errors were encountered: