Fixed issue: NETTY-157 NioServerSocketChannel.close() does not trigger a channelUnbound event.

* Fixed a case where channelUnbound event is not fired if the specified future is the close future actually
This commit is contained in:
Trustin Lee 2009-05-21 11:03:58 +00:00
parent 77742f5cf9
commit ad6888a635

View File

@ -178,12 +178,14 @@ class NioServerSocketPipelineSink extends AbstractChannelSink {
boolean bound = channel.isBound();
try {
channel.socket.close();
future.setSuccess();
if (channel.setClosed()) {
future.setSuccess();
if (bound) {
fireChannelUnbound(channel);
}
fireChannelClosed(channel);
} else {
future.setSuccess();
}
} catch (Throwable t) {
future.setFailure(t);