I write a comunication program with c/s mode in C# ,server and client program on different computer. Today after client progarm connected to server progarm ,then I pulled out cable from network adapter (after this , client and server program didn't do anything), stranger thing happened. I found out socket of server program still keep connected status. and I use command "netstat -a -n" to retrieve network information ,and get information like following :
TCP 192.168.1.2:3645 192.168.1.3:1863 ESTABLISHED
192.168.1.2 (Server IP Address) 192.168.1.3 (Client IP Address)
Do anyone know the reason ? how to solve this problem . I wanna how server program can receive the event and close the socket when network cable of client computer has been pulled out.
Please give me some advices or solutions.
Thanks