2 Replies Latest reply on Aug 19, 2009 2:58 PM by Kevin Lester

    Socket Timeout?

    Kevin Lester Newbie

      Is there a property that can be set for JBoss remoting that will set a socket response timeout in a way similar to the "sun.rmi.transport.tcp.responseTimeout"property for Sun's rmi implementation? Basically we would like to time out a socket connection if it takes too long to complete.

      We are using JBoss AS 4.0.5, and we have recently seen an issue where client's threads get stuck communicating with the server (due to OutOfMemory errors) while invoking a remote EJB. To prevent this from occurring again, we would like to enforce a timeout for all communication between the client and the server.

      Is there a way to time out a connection in JBoss if it takes too long? Unfortunately, the "jnp.sotimeout" and the "jnp.timeout" properties do not do this.

      Thanks in advance.

        • 1. Re: Socket Timeout?
          Ron Sigal Master

          If you're using the UnifiedInvoker, which is based on JBossRemoting, then you can go to $JBOSS_HOME/server/$CONFIG/conf/jboss-service.xml and update the "jboss.remoting:service=Connector,transport=socket" MBean with a "timeout" parameter:

          <mbean code="org.jboss.remoting.transport.Connector"
           display-name="Socket transport Connector">
           <attribute name="Configuration">
           <invoker transport="socket">
           <!-- set timeout to one minute -->
           <attribute name="timeout" isParam="true">60000</attribute>

          • 2. Re: Socket Timeout?
            Kevin Lester Newbie

            Thanks for the info, that was the nudge that I needed to get the timeouts to work.

            See http://www.jboss.org/index.html?module=bb&op=viewtopic&t=152166 for the full details on how to get this to work.