hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1444383 - /httpcomponents/httpcore/branches/4.2.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java
Date Sat, 09 Feb 2013 16:07:31 GMT
Author: olegk
Date: Sat Feb  9 16:07:31 2013
New Revision: 1444383

URL: http://svn.apache.org/r1444383
Log:
Accept as many as incoming connections as possible from the listener's server channel

Modified:
    httpcomponents/httpcore/branches/4.2.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java

Modified: httpcomponents/httpcore/branches/4.2.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.2.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java?rev=1444383&r1=1444382&r2=1444383&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.2.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java
(original)
+++ httpcomponents/httpcore/branches/4.2.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java
Sat Feb  9 16:07:31 2013
@@ -162,18 +162,20 @@ public class DefaultListeningIOReactor e
             if (key.isAcceptable()) {
 
                 ServerSocketChannel serverChannel = (ServerSocketChannel) key.channel();
-                SocketChannel socketChannel = null;
-                try {
-                    socketChannel = serverChannel.accept();
-                } catch (IOException ex) {
-                    if (this.exceptionHandler == null ||
-                            !this.exceptionHandler.handle(ex)) {
-                        throw new IOReactorException(
-                                "Failure accepting connection", ex);
+                for (;;) {
+                    SocketChannel socketChannel = null;
+                    try {
+                        socketChannel = serverChannel.accept();
+                    } catch (IOException ex) {
+                        if (this.exceptionHandler == null ||
+                                !this.exceptionHandler.handle(ex)) {
+                            throw new IOReactorException(
+                                    "Failure accepting connection", ex);
+                        }
+                    }
+                    if (socketChannel == null) {
+                        break;
                     }
-                }
-
-                if (socketChannel != null) {
                     try {
                         prepareSocket(socketChannel.socket());
                     } catch (IOException ex) {



Mime
View raw message