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

TCPSocket connection close by remote end reported as device error #2554

Closed
infinnovation-dev opened this issue Aug 26, 2016 · 2 comments · Fixed by #2722
Closed

TCPSocket connection close by remote end reported as device error #2554

infinnovation-dev opened this issue Aug 26, 2016 · 2 comments · Fixed by #2722

Comments

@infinnovation-dev
Copy link
Contributor

Using a test program (an echo server), I connect from a Linux PC and send a stream of data:

nc $K64F_IP_ADDRESS 7 < /dev/zero > /dev/null

and then kill the nc process with a Ctrl-C

The board gets an error code -3011 NSAPI_ERROR_DEVICE_ERROR "failure interfacing with the network procesor" (sic). This can come either from the recv() call or from the send() call - I guess depending on the timing of the event relative to the send/recv loop.

I would expect either a 0 return from recv() to indicate end of stream; or some other error from send(), maybe NSAPI_ERROR_NO_CONNECTION.

@infinnovation-dev
Copy link
Contributor Author

The underlying error in the lwip library is ERR_RST

@geky
Copy link
Contributor

geky commented Aug 26, 2016

Thanks for reporting this, looks like it was just a short-sight in handing lwip's error codes:
https://github.com/ARMmbed/mbed-os/blob/master/features/net/FEATURE_IPV4/lwip-interface/lwip_stack.c#L213

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

Successfully merging a pull request may close this issue.

2 participants