Package org.jboss.remoting.transport.multiplex

Examples of org.jboss.remoting.transport.multiplex.SocketId


      catch (IOException e1)
      {
         log.error(e1);
      }

      SocketId sid = new SocketId();
      int port = sid.getPort();
      int maxPort = port + 10;
      SocketId.setMaxPort(maxPort);
     
      for (int i = port + 1; i <= maxPort; i++)
         new SocketId().releasePort();
     
      sid = new SocketId();
      sid.releasePort();
      assertTrue(sid.getPort() == port + 1);
     
      for (int i = port + 2; i <= maxPort; i++)
         new SocketId().releasePort();
     
      sid = new SocketId();
      assertTrue(sid.getPort() == port + 1);
     
      for (int i = port + 2; i <= maxPort; i++)
         new SocketId();
     
      class TestThread extends Thread
      {
         SocketId s;
         SocketId getS() {return s;}
         public void run()
         {
            s = new SocketId();
         }
      };
     
      TestThread t = new TestThread();
      t.start();
      assertNull(t.getS());
      sid.releasePort();
      Thread.sleep(1000);
      assertTrue(t.getS().getPort() == port + 1);
      SocketId.setMaxPort(Integer.MAX_VALUE - 1);
     
      log.info("testSocketIds() PASSES");
View Full Code Here


      {
         SocketId s;
         SocketId getS() {return s;}
         public void run()
         {
            s = new SocketId();
         }
View Full Code Here

      catch (IOException e1)
      {
         log.error(e1);
      }

      SocketId sid = new SocketId();
      int port = sid.getPort();
      int maxPort = port + 10;
      SocketId.setMaxPort(maxPort);
     
      for (int i = port + 1; i <= maxPort; i++)
         new SocketId().releasePort();
     
      sid = new SocketId();
      sid.releasePort();
      assertTrue(sid.getPort() == port + 1);
     
      for (int i = port + 2; i <= maxPort; i++)
         new SocketId().releasePort();
     
      sid = new SocketId();
      assertTrue(sid.getPort() == port + 1);
     
      for (int i = port + 2; i <= maxPort; i++)
         new SocketId();
     
      class TestThread extends Thread
      {
         SocketId s;
         SocketId getS() {return s;}
         public void run()
         {
            s = new SocketId();
         }
      };
     
      TestThread t = new TestThread();
      t.start();
      assertNull(t.getS());
      sid.releasePort();
      Thread.sleep(1000);
      assertTrue(t.getS().getPort() == port + 1);
      SocketId.setMaxPort(Integer.MAX_VALUE - 1);
     
      log.info("testSocketIds() PASSES");
View Full Code Here

      {
         SocketId s;
         SocketId getS() {return s;}
         public void run()
         {
            s = new SocketId();
         }
View Full Code Here

TOP

Related Classes of org.jboss.remoting.transport.multiplex.SocketId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.