how to handle sockets associated with dead processes.

  • Thread starter Thread starter ksukat63
  • Start date Start date
K

ksukat63

Guest
Windows 10, Visual Studio 2015 Professional.

Developed a WinForm application using c# in visual studio 2015 Professional. Application communicates with a custom windows service using port 8888.

The problem Ive determined occurs when the service or application are hung/terminated. Try to start them again and get windows errors about the socket being in use. The only way to clear this is to reboot computer.

I am using:

TcpClient client = new TcpClient(ipaddress,port).

Is there a way to handle this situation in code so I dont have to reboot the computer ?


thanks.

Continue reading...
 
Back
Top