[jboss-remoting-commits] JBoss Remoting SVN: r5081 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Wed Apr 22 19:57:05 EDT 2009


Author: ron.sigal at jboss.com
Date: 2009-04-22 19:57:04 -0400 (Wed, 22 Apr 2009)
New Revision: 5081

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java
Log:
JBREM-1120: Added writeTimeout facility.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java	2009-04-22 23:56:19 UTC (rev 5080)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java	2009-04-22 23:57:04 UTC (rev 5081)
@@ -120,6 +120,7 @@
 
    private Socket socket;
    private int timeout;
+   private int writeTimeout;
    protected SocketServerInvoker invoker;
    private Constructor serverSocketConstructor;
    protected SocketWrapper socketWrapper;
@@ -156,7 +157,7 @@
    // Constructors ---------------------------------------------------------------------------------
 
    public ServerThread(Socket socket, SocketServerInvoker invoker, LRUPool clientpool,
-                       LinkedList threadpool, int timeout, String serverSocketClassName)
+                       LinkedList threadpool, int timeout, int writeTimeout, String serverSocketClassName)
       throws Exception
    {
       super();
@@ -166,6 +167,7 @@
 
       this.socket = socket;
       this.timeout = timeout;
+      this.writeTimeout = writeTimeout;
       this.serverSocketClassName = serverSocketClassName;
       this.invoker = invoker;
       this.clientpool = clientpool;
@@ -686,7 +688,7 @@
 
    protected void processInvocation(SocketWrapper socketWrapper, InputStream inputStream, OutputStream outputStream) throws Exception
    {
-      if(trace) { log.trace("preparing to process next invocation invocation"); }
+      if(trace) { log.trace("preparing to process next invocation"); }
 
       // Ok, now read invocation and invoke
 
@@ -927,7 +929,11 @@
          }
          localMetadata.put(SocketWrapper.MARSHALLER, marshaller);
          localMetadata.put(SocketWrapper.UNMARSHALLER, unmarshaller);
-
+         if (writeTimeout > 0)
+         {
+            localMetadata.put(SocketWrapper.WRITE_TIMEOUT, new Integer(writeTimeout));
+         }
+         
          serverSocketWrapper = (SocketWrapper)serverSocketConstructor.
             newInstance(new Object[]{socket, localMetadata, new Integer(timeout)});
       }




More information about the jboss-remoting-commits mailing list