[#3066] EpollDatagramChannel never calls fireChannelActive() after connect()
Motivation: EpollDragramChannel never calls fireChannelActive after connect() which is a bug. Modifications: Correctly call fireChannelActive if needed Result: Correct behaviour
This commit is contained in:
parent
b54857b9a0
commit
7ae44f8910
@ -483,6 +483,7 @@ public final class EpollDatagramChannel extends AbstractEpollChannel implements
|
|||||||
boolean success = false;
|
boolean success = false;
|
||||||
try {
|
try {
|
||||||
try {
|
try {
|
||||||
|
boolean wasActive = isActive();
|
||||||
InetSocketAddress remoteAddress = (InetSocketAddress) remote;
|
InetSocketAddress remoteAddress = (InetSocketAddress) remote;
|
||||||
if (local != null) {
|
if (local != null) {
|
||||||
InetSocketAddress localAddress = (InetSocketAddress) local;
|
InetSocketAddress localAddress = (InetSocketAddress) local;
|
||||||
@ -493,6 +494,12 @@ public final class EpollDatagramChannel extends AbstractEpollChannel implements
|
|||||||
EpollDatagramChannel.this.remote = remoteAddress;
|
EpollDatagramChannel.this.remote = remoteAddress;
|
||||||
EpollDatagramChannel.this.local = Native.localAddress(fd().intValue());
|
EpollDatagramChannel.this.local = Native.localAddress(fd().intValue());
|
||||||
success = true;
|
success = true;
|
||||||
|
|
||||||
|
// Regardless if the connection attempt was cancelled, channelActive() event should be triggered,
|
||||||
|
// because what happened is what happened.
|
||||||
|
if (!wasActive && isActive()) {
|
||||||
|
pipeline().fireChannelActive();
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (!success) {
|
if (!success) {
|
||||||
doClose();
|
doClose();
|
||||||
|
Loading…
Reference in New Issue
Block a user