JBoss Community

Re: Remote Client.addCallbackListener hang

created by Ron Sigal in JBoss Remoting - View the full discussion

Hi David,

 

I think you're on the right track.  BisocketClientInvoker.handleConnect() is waiting for a socket to use for the "control" connection.  In fact, it should already be there in the sockets Set.  When JBossMessaging sets up a connection, it calls org.jboss.remoting.Client.addListener(), which results in a call to BisocketClientInvoker.transport():

 

   protected Object transport(String sessionId, Object invocation, Map metadata,

                              Marshaller marshaller, UnMarshaller unmarshaller)

   throws IOException, ConnectionFailedException, ClassNotFoundException

   {

      String listenerId = null;

      if (invocation instanceof InvocationRequest)

      {

         InvocationRequest ir = (InvocationRequest) invocation;

         Object o = ir.getParameter();

         if (o instanceof InternalInvocation)

         {

            InternalInvocation ii = (InternalInvocation) o;

            if (InternalInvocation.ADDLISTENER.equals(ii.getMethodName())

                && ir.getLocator() != null) // getLocator() == null for pull callbacks

            {

               Map requestPayload = ir.getRequestPayload();

               listenerId = (String) requestPayload.get(Client.LISTENER_ID_KEY);

               listenerIdToClientInvokerMap.put(listenerId, this);

               BisocketServerInvoker callbackServerInvoker;

               callbackServerInvoker = BisocketServerInvoker.getBisocketServerInvoker(listenerId);

               callbackServerInvoker.createControlConnection(listenerId, true);

            }

           

            // Rather than handle the REMOVELISTENER case symmetrically, it is

            // handled when a REMOVECLIENTLISTENER message is received by

            // BisocketServerInvoker.handleInternalInvocation().  The reason is that

            // if the Client executes removeListener() with disconnectTimeout == 0,

            // no REMOVELISTENER message will be sent.

         }

      }

 

      return super.transport(sessionId, invocation, metadata, marshaller, unmarshaller);

   }

 

In particular, the call to callbackServerInvoker.createControlConnection() creates the socket on the client side whose counterpart on the server side should land in the sockets Set.  For some reason, that isn't happening.  If you can nail that down, then you've got it. 

 

Thank you for letting me know about this issue.  Please let me know how your detective work goes, and let me know if you have any questions.

 

-Ron

Reply to this message by going to Community

Start a new discussion in JBoss Remoting at Community