[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/multiplex ...

Ron Sigal ron_sigal at yahoo.com
Sat Jul 22 23:24:34 EDT 2006


  User: rsigal  
  Date: 06/07/22 23:24:34

  Modified:    src/main/org/jboss/remoting/transport/multiplex 
                        MultiplexClientInvoker.java
  Log:
  JBREM-534:  If createSocket() finds connection broken, if there is a callback server invoker, stop and restart callback server invoker.
  
  Revision  Changes    Path
  1.40      +15 -4     JBossRemoting/src/main/org/jboss/remoting/transport/multiplex/MultiplexClientInvoker.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MultiplexClientInvoker.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/multiplex/MultiplexClientInvoker.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -b -r1.39 -r1.40
  --- MultiplexClientInvoker.java	22 Jul 2006 22:00:41 -0000	1.39
  +++ MultiplexClientInvoker.java	23 Jul 2006 03:24:34 -0000	1.40
  @@ -495,6 +495,7 @@
                  InetAddress bindAddress = bindSocketAddress.getAddress();
                  int bindPort = PortUtil.findFreePort(bindSocketAddress.getHostName());
                  System.out.println("new bindPort: " + bindPort);
  +               socketGroupInfo.setBindPort(bindPort);
                  bindSocketAddress = new InetSocketAddress(bindAddress, bindPort);
                  MultiplexServerInvoker.createPrimingSocket(socketGroupInfo,
                                                             connectHost, connectPort,
  @@ -506,13 +507,23 @@
                                                             connectHost, connectPort,
                                                             configuration, port);
               
  -            // Create new server socket for callback server invoker, if it exists.
               MultiplexServerInvoker serverInvoker = socketGroupInfo.getServerInvoker();
               if (serverInvoker != null)
               {
  -               serverInvoker.setBindPort(bindSocketAddress.getPort());
  -               System.out.println("*******calling refreshServerSocket()");
  +               try
  +               {
  +                  // Restart callback server invoker with new server socket.
  +                  serverInvoker.stop();
  +                  socketGroupInfo.setServerInvoker(null);
  +                  serverInvoker.resetLocator(bindSocketAddress.getPort());
                  serverInvoker.refreshServerSocket();
  +                  serverInvoker.setup();
  +                  serverInvoker.start();
  +               }
  +               catch (Exception e)
  +               {
  +                  e.printStackTrace();
  +               }
               }
               
               VirtualSocket socket = new VirtualSocket(configuration);
  
  
  



More information about the jboss-cvs-commits mailing list