Cedric,

Our NIO subsystem in LCDS was refactored for the 2.6 release to allow us to 
support multiple higher level protocols in addition to RTMP so some things, 
including some logging output have changed from 2.5.x to 2.6.

When a client shuts down, or manually disconnects an RTMPChannel, the server 
TCP stack may receive an abort for the socket rather than a TCP close handshake 
– that’s fine, I’m just pointing out that there are different ways that the 
server is notified of a socket closing. In the case of an abort, we receive an 
IOException for the socket, but we handle it – you don’t need to. Our handler 
code simply logs out at the debug level when this happens, because as I said 
before, when you’re debugging low level connectivity it’s useful to see as much 
of exactly what is going on as possible. So, we have:

try
{
   // Read from the Connection – in most cases we read some data sent by the 
client.
   // If the client closed its end of the socket with a TCP FIN handshake we 
read an EOF and close down our end.
   // We may get an IOException from our read call for a variety of reasons; 
one of which is the client aborting
   // the socket.
  … code …
}
catch (IOException e)
{
    if (Log.isDebug())
        Log.getLogger(logCategory).debug(Thread.currentThread() + " failed to 
read Connection '" + id + "'; connection will close.", e);
}

As you can see here, the IOException is fully handled. In the case of a client 
simply aborting its TCP socket it isn't really an error condition even though 
Java throws us an IOException, so there's nothing else you need to do. If 
something in your app is breaking, let us know. Otherwise, just ignore this 
debug level log statement, or raise your server log level above DEBUG or don't 
include "SocketServer.*" in your server log filters in which case this won’t be 
output to your log file.

Best,
Seth

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of 
kcCedrics
Sent: Wednesday, September 17, 2008 12:17 AM
To: [email protected]
Subject: RE: [flexcoders] IOException on DataService closing


Hi Seth,
thanks for your answer. The thing I don't understand is that error doesn't
appear when I used LCDS 2.5!! it appears just since I use the 2.6 version.
So, is there any way to catch this exception?? or maybe there's another way
to disconnect a channel from DataService?

Cédric

Reply via email to