You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2013/02/09 17:07:31 UTC
svn commit: r1444383 -
/httpcomponents/httpcore/branches/4.2.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultListeningIOReactor.java
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) {