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 ad320f6cae
commit 8eb2d8eb43

View File

@ -262,11 +262,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));
}
}
@ -279,11 +279,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));
}
}