[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/detection/jndi ...

Ron Sigal ron_sigal at yahoo.com
Thu Nov 2 14:00:46 EST 2006


  User: rsigal  
  Date: 06/11/02 14:00:46

  Modified:    src/tests/org/jboss/test/remoting/detection/jndi  Tag:
                        remoting_2_x RestartTestClient.java
  Log:
  JBREM-581:  Make several retries until server's synchronization ServerSocket is available.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +20 -1     JBossRemoting/src/tests/org/jboss/test/remoting/detection/jndi/RestartTestClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RestartTestClient.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/detection/jndi/RestartTestClient.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -b -r1.1 -r1.1.2.1
  --- RestartTestClient.java	11 Oct 2006 19:18:53 -0000	1.1
  +++ RestartTestClient.java	2 Nov 2006 19:00:46 -0000	1.1.2.1
  @@ -108,7 +108,26 @@
         try
         {
            String host = InetAddress.getLocalHost().getHostName();
  -         Socket s = new Socket(host, RestartTestServer.syncPort);
  +         
  +         Socket s = null;
  +         for (int i = 0; i < 5; i++)
  +         {
  +            try
  +            {
  +               s = new Socket(host, RestartTestServer.syncPort);
  +               break;
  +            }
  +            catch (Exception e)
  +            {
  +               log.info("Unable to connect to " + host + ":" + RestartTestServer.syncPort);
  +               log.info("Will try again");
  +               try
  +               {
  +                  Thread.sleep(2000);
  +               }
  +               catch (InterruptedException ignored) {}
  +            }
  +         }
            InputStream is = s.getInputStream();
            OutputStream os = s.getOutputStream();
            
  
  
  



More information about the jboss-cvs-commits mailing list