[jboss-user] [Remoting] - Re: Socket keep alive with client EJB
do-not-reply at jboss.com
Wed Dec 31 02:37:45 EST 2008
"slimamar" wrote :
| Using JBoss Remoting 2.4.0 with JBossAS 5.0.0Beta4, the parameter 'invokerDestructionDelay' is taken into account and the socket connection is reused for all client requests.
| But with JBossAS 5.0.0GA and JBoss Remoting 2.5.0SP2 embedded, the socket connection is closed, apparently by the server, after 60 seconds of inactivity.
| The value of 'invokerDestructionDelay' is 28800000.
These two behaviors aren't really contradictory. There are two things going on. On the client side, setting "invokerDestructionDelay" allows the client invoker, with its connection pool, to stay alive longer than it would otherwise. Suppose you set "invokerDestructionDelay" to 10000 and you create, connect, invoke upon, and disconnect a new org.jboss.remoting.Client every five seconds. Since the client invoker stays alive for ten seconds, it will still be there when you create the next Client, and the existing connection will get reused.
On the server side, the connection is managed by a worker thread which, when it is not executing an invocation, is waiting in a socket read(). When it times out, which it does in 60 seconds by default, the socket is closed and the worker thread is returned to the thread pool.
If you make an invocation every five seconds, then the socket on the server side will never time out, and the same connection will be used every time. On the other hand, if you make an invocation every two minutes, then, even though you use the same client invoker with the same connection pool each time, you won't be able to reuse the old connection, which gets closed after sixty seconds, so each invocation will use a new connection.
So the frequency of the invocations and the server side timeout determine if you get to reuse connections.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199002#4199002
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199002
More information about the jboss-user