Fix UDP Multicast writes #237

This commit is contained in:
norman 2012-04-02 14:38:07 +02:00
parent 2c3fef467a
commit 0334267b51
2 changed files with 12 additions and 8 deletions

View File

@ -163,14 +163,6 @@ abstract class AbstractNioChannel<C extends SelectableChannel & WritableByteChan
super.setInterestOpsNow(interestOps);
}
@Override
public ChannelFuture write(Object message, SocketAddress remoteAddress) {
if (remoteAddress == null || remoteAddress.equals(getRemoteAddress())) {
return super.write(message, null);
} else {
return getUnsupportedOperationFuture();
}
}
@Override
public int getInterestOps() {

View File

@ -16,10 +16,12 @@
package org.jboss.netty.channel.socket.nio;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.channels.SocketChannel;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFactory;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelSink;
@ -91,4 +93,14 @@ public class NioSocketChannel extends AbstractNioChannel<SocketChannel>
InetSocketAddress getRemoteSocketAddress() throws Exception {
return (InetSocketAddress) channel.socket().getRemoteSocketAddress();
}
@Override
public ChannelFuture write(Object message, SocketAddress remoteAddress) {
if (remoteAddress == null || remoteAddress.equals(getRemoteAddress())) {
return super.write(message, null);
} else {
return getUnsupportedOperationFuture();
}
}
}