socket connection not being reset correctly
- From: "Allan Bruce" <amb@xxxxxxx>
- Date: Thu, 21 Jul 2005 12:43:42 +0100
I have an instant messenger server written in Java and running on linux. If
the connection between the client (C++ win32) gets broken for any reason
(e.g. network cable pulled) then the server doesn't notice and still thinks
the connection is intact. Whats more, we send out data on the connection
every 60 seconds to 'test' the connection, but the server is still not
detecting an error in the connection. At least I would have thought that
trying to send out data on a broken connection would cause it to fail.
I used to run the server on windows and I'm pretty sure that this behaviour
was not apparent then. Are there any known issues of this on linux? or am I
doing something wrong with my code (below)?
Thanks,
Allan
lreader = new BufferedReader(new SocketInputStream(lCCB.getSocket));
try
{
String lread = lreader.readLine();
if (lread == null)
{
throw new Exception("Graceful client disconnect");
}
}
catch (Exception e)
{
dosconnectedCLient(lCCB);
}
.
- Follow-Ups:
- Re: socket connection not being reset correctly
- From: Alan Krueger
- Re: socket connection not being reset correctly
- Prev by Date: Re: NullPointerException: Help needed
- Next by Date: Re: running a jar file via perl cgi
- Previous by thread: JVM Issue on Linux
- Next by thread: Re: socket connection not being reset correctly
- Index(es):
Relevant Pages
|
|