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

Tom Elrod tom.elrod at jboss.com
Mon Oct 30 23:21:07 EST 2006


  User: telrod  
  Date: 06/10/30 23:21:07

  Modified:    src/main/org/jboss/remoting/transport/socket    Tag:
                        remoting_2_x ClientSocketWrapper.java
                        ServerSocketWrapper.java ServerThread.java
  Log:
  JBREM-597 - updated socket invoker to use raw socket stream instead of passing marshaller/unmarshaller object stream wrapping the raw socket stream.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.15.10.1 +20 -14    JBossRemoting/src/main/org/jboss/remoting/transport/socket/ClientSocketWrapper.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ClientSocketWrapper.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/socket/ClientSocketWrapper.java,v
  retrieving revision 1.15
  retrieving revision 1.15.10.1
  diff -u -b -r1.15 -r1.15.10.1
  --- ClientSocketWrapper.java	30 Dec 2005 05:26:38 -0000	1.15
  +++ ClientSocketWrapper.java	31 Oct 2006 04:21:07 -0000	1.15.10.1
  @@ -39,8 +39,8 @@
    */
   public class ClientSocketWrapper extends SocketWrapper
   {
  -   private ObjectInputStream in;
  -   private ObjectOutputStream out;
  +   private InputStream in;
  +   private OutputStream out;
   
      public ClientSocketWrapper(Socket socket) throws IOException
      {
  @@ -76,20 +76,22 @@
         in = createInputStream(serializationType, socket);
      }
   
  -   protected ObjectInputStream createInputStream(String serializationType, Socket socket)
  +   protected InputStream createInputStream(String serializationType, Socket socket)
            throws IOException
      {
  -      BufferedInputStream bin = new BufferedInputStream(socket.getInputStream());
  -      ObjectInputStream oin = SerializationStreamFactory.getManagerInstance(serializationType).createInput(bin, null);
  -      return oin;
  +//      BufferedInputStream bin = new BufferedInputStream(socket.getInputStream());
  +//      ObjectInputStream oin = SerializationStreamFactory.getManagerInstance(serializationType).createInput(bin, null);
  +//      return oin;
  +      return socket.getInputStream();
      }
   
  -   protected ObjectOutputStream createOutputStream(String serializationType, Socket socket)
  +   protected OutputStream createOutputStream(String serializationType, Socket socket)
            throws IOException
      {
  -      BufferedOutputStream bout = new BufferedOutputStream(socket.getOutputStream());
  -      ObjectOutputStream oout = SerializationStreamFactory.getManagerInstance(serializationType).createOutput(bout);
  -      return oout;
  +//      BufferedOutputStream bout = new BufferedOutputStream(socket.getOutputStream());
  +//      ObjectOutputStream oout = SerializationStreamFactory.getManagerInstance(serializationType).createOutput(bout);
  +//      return oout;
  +      return socket.getOutputStream();
      }
   
      public OutputStream getOutputStream()
  @@ -104,13 +106,17 @@
   
      public void checkConnection() throws IOException
      {
  +      System.out.println(this + " checkConnectionCalled()");
         // Test to see if socket is alive by send ACK message
         final byte ACK = 1;
   
  -      out.reset();
  -      out.writeByte(ACK);
  -      out.flush();
  -      in.readByte();
  +//      out.reset();
  +//      out.writeByte(ACK);
  +//      out.flush();
  +//      in.readByte();
   
  +      out.write(ACK);
  +      out.flush();
  +      in.read();
      }
   }
  
  
  
  1.14.6.1  +26 -14    JBossRemoting/src/main/org/jboss/remoting/transport/socket/ServerSocketWrapper.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ServerSocketWrapper.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/socket/ServerSocketWrapper.java,v
  retrieving revision 1.14
  retrieving revision 1.14.6.1
  diff -u -b -r1.14 -r1.14.6.1
  --- ServerSocketWrapper.java	27 Mar 2006 22:47:01 -0000	1.14
  +++ ServerSocketWrapper.java	31 Oct 2006 04:21:07 -0000	1.14.6.1
  @@ -28,6 +28,8 @@
   import java.io.IOException;
   import java.io.ObjectInputStream;
   import java.io.ObjectOutputStream;
  +import java.io.InputStream;
  +import java.io.OutputStream;
   import java.net.Socket;
   import java.util.Map;
   import org.jboss.logging.Logger;
  @@ -50,31 +52,36 @@
         super(socket, metadata, timeout);
      }
   
  -   protected ObjectInputStream createInputStream(String serializationType, Socket socket) throws IOException
  +   protected InputStream createInputStream(String serializationType, Socket socket) throws IOException
      {
  -      BufferedInputStream bin = new BufferedInputStream(socket.getInputStream());
  -      ObjectInputStream oin = SerializationStreamFactory.getManagerInstance(serializationType).createInput(bin, null);
  -      return oin;
  +//      BufferedInputStream bin = new BufferedInputStream(socket.getInputStream());
  +//      ObjectInputStream oin = SerializationStreamFactory.getManagerInstance(serializationType).createInput(bin, null);
  +//      return oin;
  +      return socket.getInputStream();
      }
   
  -   protected ObjectOutputStream createOutputStream(String serializationType, Socket socket)
  +   protected OutputStream createOutputStream(String serializationType, Socket socket)
            throws IOException
      {
  -      BufferedOutputStream bout = new BufferedOutputStream(socket.getOutputStream());
  -      ObjectOutputStream oout = SerializationStreamFactory.getManagerInstance(serializationType).createOutput(bout);
  -      oout.flush();
  -      return oout;
  +//      BufferedOutputStream bout = new BufferedOutputStream(socket.getOutputStream());
  +//      ObjectOutputStream oout = SerializationStreamFactory.getManagerInstance(serializationType).createOutput(bout);
  +//      oout.flush();
  +//      return oout;
  +      return socket.getOutputStream();
      }
   
      public void checkConnection() throws IOException
      {
  +      System.out.println(this + " checkConnectionCalled()");
  +      
         // Perform acknowledgement to convince client
         // that the socket is still active
  -      byte ACK = 0;
  +      int ACK = 0;
         //long startWait = System.currentTimeMillis();
         try
         {
  -         ACK = ((ObjectInputStream) getInputStream()).readByte();
  +//         ACK = ((ObjectInputStream) getInputStream()).readByte();
  +         ACK = getInputStream().read();
         }
         catch(EOFException eof)
         {
  @@ -97,9 +104,14 @@
            log.trace("***acknowledge read byte" + Thread.currentThread());
         }
   
  -      ObjectOutputStream out = (ObjectOutputStream) getOutputStream();
  -      out.writeByte(ACK);
  +//      ObjectOutputStream out = (ObjectOutputStream) getOutputStream();
  +      OutputStream out = getOutputStream();
  +
  +//      out.writeByte(ACK);
  +//      out.flush();
  +//      out.reset();
  +
  +      out.write(ACK);
         out.flush();
  -      out.reset();
      }
   }
  
  
  
  1.29.2.1  +1 -1      JBossRemoting/src/main/org/jboss/remoting/transport/socket/ServerThread.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ServerThread.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/socket/ServerThread.java,v
  retrieving revision 1.29
  retrieving revision 1.29.2.1
  diff -u -b -r1.29 -r1.29.2.1
  --- ServerThread.java	26 Sep 2006 02:27:52 -0000	1.29
  +++ ServerThread.java	31 Oct 2006 04:21:07 -0000	1.29.2.1
  @@ -58,7 +58,7 @@
    *
    * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
    * @author <a href="mailto:tom at jboss.org">Tom Elrod</a>
  - * @version $Revision: 1.29 $
  + * @version $Revision: 1.29.2.1 $
    */
   public class ServerThread extends Thread
   {
  
  
  



More information about the jboss-cvs-commits mailing list