diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/NioDatagramWorker.java b/src/main/java/org/jboss/netty/channel/socket/nio/NioDatagramWorker.java index c2ccfbb5f4..fccaef52bf 100644 --- a/src/main/java/org/jboss/netty/channel/socket/nio/NioDatagramWorker.java +++ b/src/main/java/org/jboss/netty/channel/socket/nio/NioDatagramWorker.java @@ -28,6 +28,7 @@ import org.jboss.netty.channel.Channels; import org.jboss.netty.channel.MessageEvent; import org.jboss.netty.channel.ReceiveBufferSizePredictor; +import java.io.IOException; import java.net.SocketAddress; import java.nio.ByteBuffer; import java.nio.channels.AsynchronousCloseException; @@ -200,13 +201,16 @@ public class NioDatagramWorker extends AbstractNioWorker { if (future != null) { future.setSuccess(); } - } catch (final ClosedChannelException e) { + } catch (final IOException e) { if (future != null) { future.setFailure(e); } close(channel, succeededFuture(channel)); - throw new ChannelException( - "Failed to register a socket to the selector.", e); + + if (!(e instanceof ClosedChannelException)) { + throw new ChannelException( + "Failed to register a socket to the selector.", e); + } } } }