Reverted back to the previous MessageEvent implementation that should perform better in most cases

This commit is contained in:
Trustin Lee 2009-07-18 07:46:49 +00:00
parent 3610fa9608
commit 2cf7816903
2 changed files with 12 additions and 12 deletions

View File

@ -61,7 +61,11 @@ public class DownstreamMessageEvent implements MessageEvent {
this.channel = channel;
this.future = future;
this.message = message;
if (remoteAddress != null) {
this.remoteAddress = remoteAddress;
} else {
this.remoteAddress = channel.getRemoteAddress();
}
}
public Channel getChannel() {
@ -77,11 +81,7 @@ public class DownstreamMessageEvent implements MessageEvent {
}
public SocketAddress getRemoteAddress() {
if (remoteAddress != null) {
return remoteAddress;
} else {
return getChannel().getRemoteAddress();
}
}
@Override

View File

@ -57,7 +57,11 @@ public class UpstreamMessageEvent implements MessageEvent {
}
this.channel = channel;
this.message = message;
if (remoteAddress != null) {
this.remoteAddress = remoteAddress;
} else {
this.remoteAddress = channel.getRemoteAddress();
}
}
public Channel getChannel() {
@ -73,11 +77,7 @@ public class UpstreamMessageEvent implements MessageEvent {
}
public SocketAddress getRemoteAddress() {
if (remoteAddress != null) {
return remoteAddress;
} else {
return getChannel().getRemoteAddress();
}
}
@Override