I am running a UDP server. I open the UDP socket and bind the port. Everything works fine. Then, I force a disconnect+reconnect by disabling wifi on my router, then re-enabling it. When the cc3100 reconnects to wifi, I call Socket Close for the sockets that must be re-established. But when I call socket_close, I get the response code -8, which apparently is "socket command in execution". Then when I try to open new sockets, I get higher socket IDs and the Bind to the ports (which I was previously using) now fails with error -98, which is "Address already in use".
It appears that if you have a wifi disconnect while sockets are open, those sockets become orphaned. Like zombie sockets that cannot be closed.
Anyone else encounter this?
Or has anyone recovered from a disconnect with no problem? If so, can you tell me (at a high level) what steps you took?
I was thinking that maybe the cc3100 automatically closes all sockets once it gets disconnected, but if that were true, I would expect a different error code and I would expect the socket IDs to be reused when I open new sockets. Both the error codes and the high socket ID indicate that the socket is not closed after the disconnect+reconnect. And the close fails, so I am not sure what to do.
-Valkyrie-MT
P.S. This happens on the current v1.0 firmware (as well as the previous version)