How to keep TCP socket connection in case network adapter has been reset My client sends some data to server by TCP socket. I disable adapter, then re-enable it, hence network is restored. After all the socket continues return -1, last error is 10054(WSAECONNRESET). How can I configure socket to restore the connection after re-enabling the adapter without rebinding the socket?