Fixed a potential bug where close future might not be notified

This commit is contained in:
Trustin Lee 2010-01-09 05:39:23 +00:00
parent d924439330
commit e2086cb754

View File

@ -116,12 +116,14 @@ class NioDatagramPipelineSink extends AbstractChannelSink {
private void close(NioDatagramChannel channel, ChannelFuture future) {
try {
channel.getDatagramChannel().socket().close();
future.setSuccess();
if (channel.setClosed()) {
future.setSuccess();
if (channel.isBound()) {
fireChannelUnbound(channel);
}
fireChannelClosed(channel);
} else {
future.setSuccess();
}
} catch (final Throwable t) {
future.setFailure(t);