NETTY-439 Call channelBound/Connected from worker

* Move channelBound() to RegisterTask
* Simplify the if block in RegisterTask
This commit is contained in:
Trustin Lee 2011-10-21 15:36:06 -07:00
parent 68c9b0feeb
commit 0d78c0508d
2 changed files with 3 additions and 11 deletions

View File

@ -47,6 +47,5 @@ final class NioAcceptedSocketChannel extends NioSocketChannel {
setConnected();
fireChannelOpen(this);
fireChannelBound(this, getLocalAddress());
}
}

View File

@ -776,17 +776,10 @@ class NioWorker implements Runnable {
}
}
if (!server) {
if (!((NioClientSocketChannel) channel).boundManually) {
fireChannelBound(channel, localAddress);
}
fireChannelConnected(channel, remoteAddress);
}
// Handle the channelConnected in the worker thread
if (channel instanceof NioAcceptedSocketChannel) {
fireChannelConnected(channel, channel.getRemoteAddress());
if (server || !((NioClientSocketChannel) channel).boundManually) {
fireChannelBound(channel, localAddress);
}
fireChannelConnected(channel, remoteAddress);
}
}
}