Author: ron.sigal(a)jboss.com
Date: 2009-08-18 22:00:04 -0400 (Tue, 18 Aug 2009)
New Revision: 5366
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/transport/socket/ServerThread.java
Log:
JBREM-1120: Added writeTimeout facility.
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/transport/socket/ServerThread.java
===================================================================
---
remoting2/branches/2.2/src/main/org/jboss/remoting/transport/socket/ServerThread.java 2009-08-19
01:59:20 UTC (rev 5365)
+++
remoting2/branches/2.2/src/main/org/jboss/remoting/transport/socket/ServerThread.java 2009-08-19
02:00:04 UTC (rev 5366)
@@ -106,6 +106,7 @@
private Socket socket;
private int timeout;
+ private int writeTimeout;
protected SocketServerInvoker invoker;
private Constructor serverSocketConstructor;
protected SocketWrapper socketWrapper;
@@ -130,7 +131,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();
@@ -142,6 +143,7 @@
this.socket = socket;
this.timeout = timeout;
+ this.writeTimeout = writeTimeout;
this.serverSocketClassName = serverSocketClassName;
this.invoker = invoker;
this.clientpool = clientpool;
@@ -752,7 +754,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)});
}