diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketPipelineSink.java b/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketPipelineSink.java index 7053d8fb8c..c134cd1d4b 100644 --- a/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketPipelineSink.java +++ b/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketPipelineSink.java @@ -379,8 +379,7 @@ class NioClientSocketPipelineSink extends AbstractChannelSink { channel.socket.register( boss.selector, SelectionKey.OP_CONNECT, channel); } catch (ClosedChannelException e) { - throw new ChannelException( - "Failed to register a socket to the selector.", e); + NioWorker.close(channel, succeededFuture(channel)); } } }