james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r983420 - in /james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl: AbstractChannelPipelineFactory.java TimeoutHandler.java
Date Sun, 08 Aug 2010 14:53:48 GMT
Author: norman
Date: Sun Aug  8 14:53:48 2010
New Revision: 983420

URL: http://svn.apache.org/viewvc?rev=983420&view=rev
Log:
We only should listen for read timeout

Modified:
    james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractChannelPipelineFactory.java
    james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/TimeoutHandler.java

Modified: james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractChannelPipelineFactory.java
URL: http://svn.apache.org/viewvc/james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractChannelPipelineFactory.java?rev=983420&r1=983419&r2=983420&view=diff
==============================================================================
--- james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractChannelPipelineFactory.java
(original)
+++ james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractChannelPipelineFactory.java
Sun Aug  8 14:53:48 2010
@@ -46,7 +46,7 @@ public abstract class AbstractChannelPip
     private TimeoutHandler timeoutHandler;
     private ChannelGroupHandler groupHandler;
     public AbstractChannelPipelineFactory(int timeout, int maxConnections, int maxConnectsPerIp,
ChannelGroup channels) {
-        timeoutHandler = new TimeoutHandler(new HashedWheelTimer(), timeout, timeout, 0);
+        timeoutHandler = new TimeoutHandler(new HashedWheelTimer(), timeout);
         connectionLimitHandler = new ConnectionLimitUpstreamHandler(maxConnections);
         connectionPerIpLimitHandler = new ConnectionPerIpLimitUpstreamHandler(maxConnectsPerIp);
         groupHandler = new ChannelGroupHandler(channels);

Modified: james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/TimeoutHandler.java
URL: http://svn.apache.org/viewvc/james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/TimeoutHandler.java?rev=983420&r1=983419&r2=983420&view=diff
==============================================================================
--- james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/TimeoutHandler.java
(original)
+++ james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/TimeoutHandler.java
Sun Aug  8 14:53:48 2010
@@ -31,13 +31,15 @@ import org.jboss.netty.util.Timer;
  */
 public class TimeoutHandler extends IdleStateHandler{
 
-    public TimeoutHandler(Timer timer, int readerIdleTimeSeconds, int writerIdleTimeSeconds,
int allIdleTimeSeconds) {
-        super(timer, readerIdleTimeSeconds, writerIdleTimeSeconds, allIdleTimeSeconds);
+    public TimeoutHandler(Timer timer, int readerIdleTimeSeconds) {
+        super(timer, readerIdleTimeSeconds, 0, 0);
     }
 
     @Override
     protected void channelIdle(ChannelHandlerContext ctx, IdleState state, long lastActivityTimeMillis)
throws Exception {
-        ctx.getChannel().close();
+        if (state.equals(IdleState.READER_IDLE)) {
+            ctx.getChannel().close();
+        }
     }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message