Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Terminate TCP connection from Server

803782Oct 7 2010 — edited Oct 14 2010
Hello,

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!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 11 2010
Added on Oct 7 2010
7 comments
631 views