ChannelGroup.write() should not write to a server channel

This commit is contained in:
Trustin Lee 2011-01-31 15:25:22 +09:00
parent 31df7fa9b1
commit 339c2a6641

View File

@ -253,11 +253,11 @@ public class DefaultChannelGroup extends AbstractSet<Channel> implements Channel
new LinkedHashMap<Integer, ChannelFuture>(size());
if (message instanceof ChannelBuffer) {
ChannelBuffer buf = (ChannelBuffer) message;
for (Channel c: this) {
for (Channel c: nonServerChannels.values()) {
futures.put(c.getId(), c.write(buf.duplicate()));
}
} else {
for (Channel c: this) {
for (Channel c: nonServerChannels.values()) {
futures.put(c.getId(), c.write(message));
}
}
@ -269,11 +269,11 @@ public class DefaultChannelGroup extends AbstractSet<Channel> implements Channel
new LinkedHashMap<Integer, ChannelFuture>(size());
if (message instanceof ChannelBuffer) {
ChannelBuffer buf = (ChannelBuffer) message;
for (Channel c: this) {
for (Channel c: nonServerChannels.values()) {
futures.put(c.getId(), c.write(buf.duplicate(), remoteAddress));
}
} else {
for (Channel c: this) {
for (Channel c: nonServerChannels.values()) {
futures.put(c.getId(), c.write(message, remoteAddress));
}
}