[Remoting] - Re: Socket keep alive with client EJB
by ron.sigal@jboss.com
"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.
Make sense?
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
15 years, 12 months
[Remoting] - Re: The invoker for locator (InvokerLocator [socket://xx.xx
by ron.sigal@jboss.com
It looks like you're creating TransporterServers on the client side, right? I'm guessing each client has a TransporterServer to handle calls from the server to the client, right? So, when you recreate a client, you're also recreating a TransporterServer.
The exception " The invoker for locator ... is already in use by another Connector." is thrown when you try to create a server (org.jboss.remoting.transport.Connector) with an InvokerLocator that is currently associated with a server in the InvokerRegistry. So, clearly, when your clients are shutting down, the TransporterServer's Connector is not shutting down.
When you explicitly remove the InvokerLocator from the InvokerRegistry, you're just masking the problem: the server is still running and its ServerSocket is still bound.
Now, I don't know why your TransportServer isn't getting closed. Check your code ... .
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4198997#4198997
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4198997
15 years, 12 months