Terminate TCP connection from Server
803782Oct 7 2010 — edited Oct 14 2010Hello,
I am implementing a server: I open the port and wait for a client, when the client ask for a connection, i accept() it and start working with it. When i have done everything with the client i close the socket, we make the 3-ways protocol and everything is ok.
The problem comes when the client is disconnected suddenly, in a wrong way (no power on the client, the connection comes down, ....), then if i close() the socket (the client accepted socket), i send the FIN signal but obviously i have no response, and the connection STAYS UP, and i have no way to bring it down, actually, even if i close my server program, the connection is still there for the whole life. The problem is that if I want to connect again with this client, this "forgotten" connection interferes.
Does anybody knows how can i shut the connection in this case?
Thanks!