Make sure Channel connected event is not fired on connect failure. See #249

This commit is contained in:
norman 2012-04-04 07:43:52 +02:00
parent 6995701f20
commit 33f9d55bc4

View File

@ -186,6 +186,11 @@ public class NioWorker extends AbstractNioWorker {
channel.setConnected();
future.setSuccess();
}
if (server || !((NioClientSocketChannel) channel).boundManually) {
fireChannelBound(channel, localAddress);
}
fireChannelConnected(channel, remoteAddress);
} catch (IOException e) {
if (future != null) {
future.setFailure(e);
@ -197,10 +202,6 @@ public class NioWorker extends AbstractNioWorker {
}
}
if (server || !((NioClientSocketChannel) channel).boundManually) {
fireChannelBound(channel, localAddress);
}
fireChannelConnected(channel, remoteAddress);
}
}