tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1641280 - in /tomcat/trunk/java/org/apache/tomcat/util/net: AprEndpoint.java Nio2Endpoint.java NioEndpoint.java SocketWrapperBase.java
Date Sun, 23 Nov 2014 22:50:33 GMT
Author: markt
Date: Sun Nov 23 22:50:32 2014
New Revision: 1641280

URL: http://svn.apache.org/r1641280
Log:
Add registerForEvent to Endpoint

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapperBase.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1641280&r1=1641279&r2=1641280&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Sun Nov 23 22:50:32 2014
@@ -2597,5 +2597,12 @@ public class AprEndpoint extends Abstrac
         public void flush() {
             // NO-OP
         }
+
+
+        @Override
+        public void regsiterForEvent(boolean read, boolean write) {
+            ((AprEndpoint) getEndpoint()).getPoller().add(
+                    getSocket().longValue(), -1, read, write);
+        }
     }
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java?rev=1641280&r1=1641279&r2=1641280&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java Sun Nov 23 22:50:32 2014
@@ -1111,6 +1111,11 @@ public class Nio2Endpoint extends Abstra
                 throw ex;
             }
         }
+
+        @Override
+        public void regsiterForEvent(boolean read, boolean write) {
+            // NO-OP. Appropriate handlers will already have been registered.
+        }
     }
 
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1641280&r1=1641279&r2=1641280&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Sun Nov 23 22:50:32 2014
@@ -1619,6 +1619,20 @@ public class NioEndpoint extends Abstrac
                 }
             }
         }
+
+        @Override
+        public void regsiterForEvent(boolean read, boolean write) {
+            SelectionKey key = getSocket().getIOChannel().keyFor(
+                    getSocket().getPoller().getSelector());
+            if (read) {
+                this.interestOps(this.interestOps() | SelectionKey.OP_READ);
+                key.interestOps(key.interestOps() | SelectionKey.OP_READ);
+            }
+            if (write) {
+                this.interestOps(this.interestOps() | SelectionKey.OP_WRITE);
+                key.interestOps(key.interestOps() | SelectionKey.OP_READ);
+            }
+        }
     }
 
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapperBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapperBase.java?rev=1641280&r1=1641279&r2=1641280&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapperBase.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapperBase.java Sun Nov 23 22:50:32
2014
@@ -235,4 +235,6 @@ public abstract class SocketWrapperBase<
 
     public abstract int write(boolean block, byte[] b, int off, int len) throws IOException;
     public abstract void flush() throws IOException;
+
+    public abstract void regsiterForEvent(boolean read, boolean write);
 }



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


Mime
View raw message