diff --git a/src/com/barchart/udt/nio/SelectorProviderUDT.java b/src/com/barchart/udt/nio/SelectorProviderUDT.java index 65290e13..43238fc6 100644 --- a/src/com/barchart/udt/nio/SelectorProviderUDT.java +++ b/src/com/barchart/udt/nio/SelectorProviderUDT.java @@ -11,6 +11,7 @@ import com.barchart.udt.SocketUDT; import com.barchart.udt.TypeUDT; import java.io.IOException; +import java.net.ProtocolFamily; import java.nio.channels.DatagramChannel; import java.nio.channels.Pipe; import java.nio.channels.spi.SelectorProvider; @@ -79,6 +80,11 @@ public class SelectorProviderUDT extends SelectorProvider { throw new UnsupportedOperationException("feature not available"); } + @Override + public DatagramChannel openDatagramChannel(final ProtocolFamily family) throws IOException { + throw new UnsupportedOperationException("feature not available"); + } + /** * Not supported. */ diff --git a/src/com/barchart/udt/nio/ServerSocketChannelUDT.java b/src/com/barchart/udt/nio/ServerSocketChannelUDT.java index 86740903..1f22ea26 100644 --- a/src/com/barchart/udt/nio/ServerSocketChannelUDT.java +++ b/src/com/barchart/udt/nio/ServerSocketChannelUDT.java @@ -14,7 +14,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; +import java.net.SocketAddress; +import java.net.SocketOption; import java.nio.channels.ServerSocketChannel; +import java.util.Set; /** * {@link ServerSocketChannel}-like wrapper for {@link SocketUDT} can be either @@ -25,7 +28,7 @@ import java.nio.channels.ServerSocketChannel; * {@link ServerSocketChannel#open()}; *
* example: - * + * *
* SelectorProvider provider = SelectorProviderUDT.DATAGRAM; * ServerSocketChannel acceptChannel = provider.openServerSocketChannel(); @@ -109,6 +112,26 @@ public class ServerSocketChannelUDT extends ServerSocketChannel implements Chann return (SelectorProviderUDT) super.provider(); } + @Override + public ServerSocketChannel bind(final SocketAddress local, final int backlog) throws IOException { + throw new UnsupportedOperationException("feature not available"); + } + + @Override + publicServerSocketChannel setOption(final SocketOption name, final T value) throws IOException { + throw new UnsupportedOperationException("feature not available"); + } + + @Override + public T getOption(final SocketOption name) throws IOException { + throw new UnsupportedOperationException("feature not available"); + } + + @Override + public Set > supportedOptions() { + throw new UnsupportedOperationException("feature not available"); + } + @Override public synchronized NioServerSocketUDT socket() { if (socketAdapter == null) { @@ -136,4 +159,9 @@ public class ServerSocketChannelUDT extends ServerSocketChannel implements Chann public TypeUDT typeUDT() { return providerUDT().type(); } + + @Override + public SocketAddress getLocalAddress() throws IOException { + throw new UnsupportedOperationException("feature not available"); + } } diff --git a/src/com/barchart/udt/nio/SocketChannelUDT.java b/src/com/barchart/udt/nio/SocketChannelUDT.java index edd3f5cf..fdf760a2 100644 --- a/src/com/barchart/udt/nio/SocketChannelUDT.java +++ b/src/com/barchart/udt/nio/SocketChannelUDT.java @@ -17,12 +17,14 @@ import org.slf4j.LoggerFactory; import java.io.IOException; import java.net.InetSocketAddress; import java.net.SocketAddress; +import java.net.SocketOption; import java.nio.ByteBuffer; import java.nio.channels.ClosedChannelException; import java.nio.channels.ConnectionPendingException; import java.nio.channels.IllegalBlockingModeException; import java.nio.channels.SocketChannel; import java.nio.channels.UnresolvedAddressException; +import java.util.Set; /** * {@link SocketChannel}-like wrapper for {@link SocketUDT}, can be either @@ -38,7 +40,7 @@ import java.nio.channels.UnresolvedAddressException; * {@link SocketChannel#open()}; * * example: - * + * *
* SelectorProvider provider = SelectorProviderUDT.DATAGRAM; * SocketChannel clientChannel = provider.openSocketChannel(); @@ -74,8 +76,6 @@ public class SocketChannelUDT extends SocketChannel implements ChannelUDT { protected final SocketUDT socketUDT; - private SocketAddress localAddress; - private InetSocketAddress remoteSocket; protected SocketChannelUDT( // @@ -242,13 +242,10 @@ public class SocketChannelUDT extends SocketChannel implements ChannelUDT { } -// @Override -// public SocketAddress getRemoteAddress() throws IOException { -// if(this.isConnectFinished()) { -// return remoteSocket; -// } -// return null; -// } + @Override + public SocketAddress getRemoteAddress() throws IOException { + throw new UnsupportedOperationException("feature not available"); + } @Override protected void implCloseSelectableChannel() throws IOException { @@ -292,7 +289,7 @@ public class SocketChannelUDT extends SocketChannel implements ChannelUDT { /** * See {@link SocketChannel#read(ByteBuffer)} contract; * note: this method does not return (-1) as EOS (end of stream flag) - * + * * @return<0
should not happen
*=0
blocking mode: timeout occurred on receive
*=0
non-blocking mode: nothing is received by the @@ -396,7 +393,7 @@ public class SocketChannelUDT extends SocketChannel implements ChannelUDT { /** * See {@link SocketChannel#write(ByteBuffer)} contract; - * + * * @return<0
should not happen
*=0
blocking mode: timeout occurred on send
*=0
non-blocking mode: buffer is full in the @@ -533,11 +530,33 @@ public class SocketChannelUDT extends SocketChannel implements ChannelUDT { } -// @Override -// public SocketAddress getLocalAddress() throws IOException { -// if(this.isConnected()) { -// return localAddress; -// } -// return null; -// } + @Override + publicSocketChannel setOption(final SocketOption name, final T value) throws IOException { + throw new UnsupportedOperationException("feature not available"); + } + + @Override + public T getOption(final SocketOption name) throws IOException { + throw new UnsupportedOperationException("feature not available"); + } + + @Override + public Set > supportedOptions() { + throw new UnsupportedOperationException("feature not available"); + } + + @Override + public SocketChannel shutdownInput() throws IOException { + throw new UnsupportedOperationException("feature not available"); + } + + @Override + public SocketChannel shutdownOutput() throws IOException { + throw new UnsupportedOperationException("feature not available"); + } + + @Override + public SocketAddress getLocalAddress() throws IOException { + throw new UnsupportedOperationException("feature not available"); + } }