From 052a109bc94355744f563b01e2fa63d863251570 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Sat, 9 Jan 2010 08:38:12 +0000 Subject: [PATCH] Fixed an assertion error where NioSocketChannel.setConnected() is called on a closed channel --- .../org/jboss/netty/channel/socket/nio/NioSocketChannel.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/NioSocketChannel.java b/src/main/java/org/jboss/netty/channel/socket/nio/NioSocketChannel.java index 50ce6c8001..565206b806 100644 --- a/src/main/java/org/jboss/netty/channel/socket/nio/NioSocketChannel.java +++ b/src/main/java/org/jboss/netty/channel/socket/nio/NioSocketChannel.java @@ -133,8 +133,9 @@ class NioSocketChannel extends AbstractChannel } final void setConnected() { - assert state == ST_OPEN || state == ST_BOUND : "Invalid state: " + state; - state = ST_CONNECTED; + if (state != ST_CLOSED) { + state = ST_CONNECTED; + } } @Override