1
votes

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?

1

1 Answers

1
votes

The other machine noticed the connection was dead and shut it down. Then you tried to use it.

Look to the other machine if you want this to work.

Better idea: handle network failures with delay-retry on new connection no matter the cause.