Closed csunday95 closed 2 years ago
I'm unable to reproduce this.
When testing your example, calling recv
does not block and will set errno to EWOULDBLOCK
, like expected.
Your example seems to be missing the "waiting to recv" log message from your expected output. After adding that at line 126, the output matches the expected output.
It appears that the current socket implementation doesn't respect non-blocking socket operations. The below program should immediately exit recv with a value of -1 for
bytesReceived
, but it seems to block.An example python script to test
Expected Output:
Actual Output
This demonstrates that the recv() call is blocking despite the socket having O_NONBLOCK set and MSG_DONTWAIT being passed. Its possible that this simply isn't implemented yet, but I was unable to find that documented anywhere. It's also possible I'm just missing some step of initialization to enable non-blocking operations.