Step 4 always results in an infinite loop in lwip_tcp.c : lines 425-426.
cc @geky
Please file these issues with a test case or example program or code snippet to reproduce.
ARM Internal Ref: IOTMORF-443
Looking into this more, it appears lwip does not handling rebinding sockets.
In BSD sockets, bind is similarly not allowed more than once:
http://man7.org/linux/man-pages/man2/bind.2.html
Fortunately, the state of the socket can be determined from the netconn struct, so changing the behaviour to return NSAPI_ERROR_PARAMETER is preferential to a non-halt state.
Added a check per the above behaviour here: https://github.com/ARMmbed/mbed-os/pull/2580
Let us know if there is still an issue.
changing the behaviour to return NSAPI_ERROR_PARAMETER is preferential to a non-halt state
Yep, that sounds good. I'll try it out.
This has been fixed. Closing.