[xSocket-develop] closed connections
Status: Inactive
Brought to you by:
grro
|
From: Laura S. <mar...@al...> - 2009-06-11 06:34:43
|
Hello, I've implemented a server application based on xsocket library that accepts a limited number of connections in a non-blocking manner. Connections are kept in a list of active connections. Each one has a callback handler to manage asynchronous communication which implements IDataHandler, IConnectHandler, IDisconnectHandler, IIdleTimeoutHandler, IConnectionTimeoutHandler. This server should communicate with a simple socket based client that opens a number of socket connections, these are kept "persistent" in a list and used when a XML request should be sent to the server. socket1[i] = new Socket(); socket1[i].setSoLinger(true, 1); socket1[i].bind(null); socket1[i].connect(new InetSocketAddress(ipCms1, port1), timeout); // timeout established at 30 * 60 *1000 This client could send XML requests and keep alive messages. Server responds only to XML requests, keep alive messages are received and recorded. In case communication errors appear, the persistent connections are recreated by a distinct thread. The problem is that after a number of keep-alive messages are sent, something happens and the connections are closed...On server side this is recorded. 13:25:45,086 [xServerPool-1-thread-6] ERROR [PRBT TQS -- DataHandler] Exception occured. Check the stack trace... 13:25:45,086 [xServerPool-1-thread-6] DEBUG Stack Trace:: org.xsocket.connection.ExtendedClosedChannelException: channel is closed (read buffer size=0) at org.xsocket.connection.AbstractNonBlockingStream.readByteBufferByDelimiter(A bstractNonBlockingStream.java:546) I need advice to debug this...to diagnose who or what could close the connections. They are not explicitly closed on client or on server side, and it's not a timeout value reached because no SocketTimeoutExceptions on client side are caught. If this situation happens, the connections seem to be closed regularly at 50000 or 60000 ms. Any idea is highly appreciated ! Thanks a lot by advance, Laura Laura Sebu Alcatel-Lucent IT S&D Department Str. Gh. Lazar, nr. 9, Timisoara 300081, Romania Email: Mar...@al... Phone: +40 256 303100/6266 Fax: +40 256 303413 |