Class SocketChannelUDT

All Implemented Interfaces:
ChannelUDT, Closeable, AutoCloseable, ByteChannel, Channel, GatheringByteChannel, InterruptibleChannel, NetworkChannel, ReadableByteChannel, ScatteringByteChannel, WritableByteChannel
Direct Known Subclasses:
RendezvousChannelUDT

public class SocketChannelUDT extends SocketChannel implements ChannelUDT
SocketChannel-like wrapper for SocketUDT, can be either stream or message oriented, depending on TypeUDT

The UDT socket that this SocketChannel wraps will be switched to blocking mode since this is the default for all SocketChannels on construction. If you require non-blocking functionality, you will need to call configureBlocking on the constructed SocketChannel class.

you must use SelectorProviderUDT.openSocketChannel() to obtain instance of this class; do not use JDK SocketChannel.open();

example:

 SelectorProvider provider = SelectorProviderUDT.DATAGRAM;
 SocketChannel clientChannel = provider.openSocketChannel();
 clientChannel.configureBlocking(true);
 Socket clientSocket = clientChannel.socket();
 InetSocketAddress clientAddress = new InetSocketAddress("localhost", 10000);
 clientSocket.bind(clientAddress);
 assert clientSocket.isBound();
 InetSocketAddress serverAddress = new InetSocketAddress("localhost", 12345);
 clientChannel.connect(serverAddress);
 assert clientSocket.isConnected();