diff --git a/transport/src/main/java/io/netty/channel/socket/nio/NioWorker.java b/transport/src/main/java/io/netty/channel/socket/nio/NioWorker.java index a6b31cc45e..6b5047064c 100644 --- a/transport/src/main/java/io/netty/channel/socket/nio/NioWorker.java +++ b/transport/src/main/java/io/netty/channel/socket/nio/NioWorker.java @@ -136,7 +136,9 @@ public class NioWorker extends AbstractNioWorker { setInterestOps(channel, future, channel.getRawInterestOps()); } if (future != null) { - ((NioSocketChannel) channel).setConnected(); + if (channel instanceof NioSocketChannel) { + ((NioSocketChannel) channel).setConnected(); + } future.setSuccess(); }