Disconnecting TcpClient in CLOSE_WAIT state

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Client (a TcpClient object) established connection with the Server(a TcpListener). I want that when the Server goes down, the TcpClient detects this disconnection and when the Server is back up, client is able to establish connection again with the server.

However when my server goes down, client socket goes in CLOSE_WAIT state
and when server comes back and tries to reconnect server socket goes into FIN_WAIT state... can I not use the same objects on both sides to reconnect?

I am using TcpClient.Close() to disconnect and have set it's LingerState option to false but why it infinitely goes into CLOSE_WAIT state?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top