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 -- View this message in context: http://www.nabble.com/IOException-on-DataService-closing-tp19488626p19526595.html Sent from the FlexCoders mailing list archive at Nabble.com.
RE: [flexcoders] IOException on DataService closing
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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of kcCedrics Sent: Wednesday, September 17, 2008 12:17 AM To: flexcoders@yahoogroups.com 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
RE: [flexcoders] IOException on DataService closing
Hi, thanks for your answer. I added the includeCategory=true option to the logging and now I'm getting this exception: 2008-09-16 10:58:51,150 INFO [STDOUT] [LCDS] [SocketServer.General] Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] Connection '9510837' starting a read. 2008-09-16 10:58:51,165 INFO [STDOUT] [LCDS] [SocketServer.General] Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] failed to read Connection '9510837'; connection will close. java.io.IOException: Une connexion existante a dû être fermée par l'hôte distant at sun.nio.ch.SocketDispatcher.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(Unknown Source) at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source) at sun.nio.ch.IOUtil.read(Unknown Source) at sun.nio.ch.SocketChannelImpl.read(Unknown Source) at flex.messaging.socketserver.Connection.doRead(Connection.java:508) at flex.messaging.socketserver.Connection$ConnectionReader.run(Connection.java:761) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Unknown Source) So I guess the pattern is [SocketServer.General] but I don't know what to do with that :) I'm running on LCDS 2.6, and like you I didn't see this message in 2.5!! Cédric -- View this message in context: http://www.nabble.com/IOException-on-DataService-closing-tp19488626p19508051.html Sent from the FlexCoders mailing list archive at Nabble.com.
RE: [flexcoders] IOException on DataService closing
Hi Cedric, That log message is just informational – it’s not an error. When a client goes away or closes its socket, often times the server TCP stack and JVM will get an IOException rather than reading a clean EOF for the socket. These messages can be useful when you’re troubleshooting networking issues, but in general you should run with the server log level at WARN or ERROR, not INFO or DEBUG. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of kcCedrics Sent: Tuesday, September 16, 2008 2:05 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] IOException on DataService closing Hi, thanks for your answer. I added the includeCategory=true option to the logging and now I'm getting this exception: 2008-09-16 10:58:51,150 INFO [STDOUT] [LCDS] [SocketServer.General] Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] Connection '9510837' starting a read. 2008-09-16 10:58:51,165 INFO [STDOUT] [LCDS] [SocketServer.General] Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] failed to read Connection '9510837'; connection will close. java.io.IOException: Une connexion existante a dû être fermée par l'hôte distant at sun.nio.ch.SocketDispatcher.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(Unknown Source) at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source) at sun.nio.ch.IOUtil.read(Unknown Source) at sun.nio.ch.SocketChannelImpl.read(Unknown Source) at flex.messaging.socketserver.Connection.doRead(Connection.java:508) at flex.messaging.socketserver.Connection$ConnectionReader.run(Connection.java:761) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Unknown Source) So I guess the pattern is [SocketServer.General] but I don't know what to do with that :) I'm running on LCDS 2.6, and like you I didn't see this message in 2.5!! Cédric -- View this message in context: http://www.nabble.com/IOException-on-DataService-closing-tp19488626p19508051.html Sent from the FlexCoders mailing list archive at Nabble.com.
RE: [flexcoders] IOException on DataService closing
It looks to me like we have an info message in there which should be a debug message at best.I'm not sure what pattern that is being logged under but if you add the includeCategory=true option to the logging you'll see that pattern and can just remove that from the pattern tags you are logging. I don't see that message at all in our 2.5.1 code base so I am guessing you are running on 2.0.1 or maybe 2.0? Jeff From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cédric Savi Sent: Monday, September 15, 2008 12:58 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] IOException on DataService closing Hello all, I've got a problem when I'm closing my application which uses a dataservice!! I think that everybody's got this problem but I didn't found any solution. So, I have a simple data service: public var ds:DataService = new DataService(MY_DESTINATION); ... public function init():void { ds.fill(myArray); } But when I'm closing my application I've got this Exception : 09:40:14,646 INFO [STDOUT] [LCDS] Thread[my-rtmp-SocketServer-WorkerThread-2,5,jboss] failed to read Connection '19881741'; connection will close. java.io.IOException: Connexion was closed by host at sun.nio.ch.SocketDispatcher.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(Unknown Source) at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source) at sun.nio.ch.IOUtil.read(Unknown Source) at sun.nio.ch.SocketChannelImpl.read(Unknown Source) at flex.messaging.socketserver.Connection.doRead(Connection.java:508) at flex.messaging.socketserver.Connection$ConnectionReader.run(Connection.java:761) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Unknown Source) So I've got the idea to add a logout button which execute this function: public function logout():void { ds.logout(); ds.disconnect(); } But when it executes the ds.disconnect() function I've got the same exception. If anybody got the answer? Thanks inline: image001.jpginline: image002.jpg