Examples of VirtualSocket


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

         serverSocket.setSoTimeout(10000);
         serverSocket.acceptServerSocketConnection();
        
         // Create 3 virtual sockets
         Thread.sleep(2000);
         Socket socket1 = new VirtualSocket(connectHost, connectPort);
         Socket socket2 = new VirtualSocket(connectHost, connectPort);
         Socket socket3 = new VirtualSocket(connectHost, connectPort);
        
         // Do some i/o.
         InputStream is1 = socket1.getInputStream();
         OutputStream os1 = socket1.getOutputStream();
         InputStream is2 = socket2.getInputStream();
         OutputStream os2 = socket2.getOutputStream();
         InputStream is3 = socket3.getInputStream();
         OutputStream os3 = socket3.getOutputStream();
         os1.write(is1.read());
         os2.write(is2.read());
         os3.write(is3.read());
        
         socket1.close();
         socket2.close();
         socket3.close();
         serverSocket.close();
      }
      catch (Exception e)
      {
         e.printStackTrace();
View Full Code Here

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

/*  69 */       serverSocket.connect(address1);
/*     */
/*  73 */       os_sync.write(5);
/*  74 */       is_sync.read();
/*  75 */       int port = serverSocket.getRemotePort();
/*  76 */       Socket virtualSocket1 = new VirtualSocket(connectHost, port);
/*  77 */       InputStream is1 = virtualSocket1.getInputStream();
/*  78 */       OutputStream os1 = virtualSocket1.getOutputStream();
/*     */
/*  81 */       Socket virtualSocket2 = serverSocket.accept();
/*  82 */       InputStream is2 = virtualSocket2.getInputStream();
/*  83 */       OutputStream os2 = virtualSocket2.getOutputStream();
/*     */
/*  86 */       os1.write(9);
/*  87 */       System.out.println(is1.read());
/*  88 */       os2.write(11);
/*  89 */       System.out.println(is2.read());
/*  90 */       virtualSocket1.close();
/*  91 */       virtualSocket2.close();
/*  92 */       syncSocket.close();
/*  93 */       serverSocket.close();
/*     */     }
/*     */     catch (Exception e)
View Full Code Here

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

/*     */ {
/*     */   public void runPrimeScenario()
/*     */   {
/*     */     try
/*     */     {
/*  50 */       Socket v1 = new VirtualSocket("localhost", 5555);
/*     */
/*  53 */       new AsynchronousThread(v1).start();
/*     */
/*  56 */       ObjectOutputStream oos = new ObjectOutputStream(v1.getOutputStream());
/*  57 */       ObjectInputStream ois = new ObjectInputStream(v1.getInputStream());
/*  58 */       oos.writeObject(new Integer(3));
/*  59 */       Integer i1 = (Integer)ois.readObject();
/*  60 */       System.out.println("synch: " + i1);
/*  61 */       v1.close();
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/*  65 */       e.printStackTrace();
/*  66 */       System.exit(1);
View Full Code Here

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

/*    */
/* 59 */       serverSocket.setSoTimeout(10000);
/* 60 */       serverSocket.acceptServerSocketConnection();
/*    */
/* 63 */       Thread.sleep(2000L);
/* 64 */       Socket socket1 = new VirtualSocket(connectHost, connectPort);
/* 65 */       Socket socket2 = new VirtualSocket(connectHost, connectPort);
/* 66 */       Socket socket3 = new VirtualSocket(connectHost, connectPort);
/*    */
/* 69 */       InputStream is1 = socket1.getInputStream();
/* 70 */       OutputStream os1 = socket1.getOutputStream();
/* 71 */       InputStream is2 = socket2.getInputStream();
/* 72 */       OutputStream os2 = socket2.getOutputStream();
/* 73 */       InputStream is3 = socket3.getInputStream();
/* 74 */       OutputStream os3 = socket3.getOutputStream();
/* 75 */       os1.write(is1.read());
/* 76 */       os2.write(is2.read());
/* 77 */       os3.write(is3.read());
/*    */
/* 79 */       socket1.close();
/* 80 */       socket2.close();
/* 81 */       socket3.close();
/* 82 */       serverSocket.close();
/*    */     }
/*    */     catch (Exception e)
/*    */     {
/* 86 */       e.printStackTrace();
View Full Code Here

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

/*     */
/*  90 */       Socket virtualSocket1 = vss.accept();
/*  91 */       InputStream is1 = virtualSocket1.getInputStream();
/*  92 */       OutputStream os1 = virtualSocket1.getOutputStream();
/*     */
/*  95 */       Socket virtualSocket2 = new VirtualSocket(connectHost, connectPort);
/*  96 */       InputStream is2 = virtualSocket2.getInputStream();
/*  97 */       OutputStream os2 = virtualSocket2.getOutputStream();
/*     */
/* 100 */       os1.write(is1.read());
/* 101 */       os2.write(is2.read());
/* 102 */       virtualSocket1.close();
/* 103 */       virtualSocket2.close();
/* 104 */       syncSocket.close();
/* 105 */       vss.close();
/*     */     }
/*     */     catch (Exception e)
/*     */     {
View Full Code Here

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

/*     */       {
/*  93 */         Thread.sleep(2000L);
/*     */
/*  96 */         String hostName = this.virtualSocket.getInetAddress().getHostName();
/*  97 */         int port = this.virtualSocket.getPort();
/*  98 */         Socket v3 = new VirtualSocket(hostName, port);
/*     */
/* 101 */         ObjectOutputStream oos = new ObjectOutputStream(v3.getOutputStream());
/* 102 */         oos.writeObject(new Integer(7));
/*     */
/* 104 */         oos.flush();
/* 105 */         v3.close();
/*     */       }
/*     */       catch (Exception e)
/*     */       {
/* 109 */         e.printStackTrace();
/* 110 */         System.exit(1);
View Full Code Here

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

/*     */   {
/* 117 */     SocketFactory sf = getSocketFactory();
/* 118 */     if (sf == null) {
/* 119 */       createSocketFactory(this.configuration);
/*     */     }
/* 121 */     VirtualSocket socket = new VirtualSocket(this.configuration);
/* 122 */     socket.connect(getConnectSocketAddress(), getBindSocketAddress(), this.timeout);
/* 123 */     return socket;
/*     */   }
View Full Code Here

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

   {
      SocketFactory sf = getSocketFactory();
      if (sf == null)
         createSocketFactory(configuration);

      VirtualSocket socket = new VirtualSocket(configuration);
      socket.connect(getConnectSocketAddress(), getBindSocketAddress(), timeout);
      return socket;
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.