Package com.barchart.udt.nio
Class ServerSocketChannelUDT
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.SelectableChannel
java.nio.channels.spi.AbstractSelectableChannel
java.nio.channels.ServerSocketChannel
com.barchart.udt.nio.ServerSocketChannelUDT
- All Implemented Interfaces:
ChannelUDT,Closeable,AutoCloseable,Channel,InterruptibleChannel,NetworkChannel
ServerSocketChannel-like wrapper for SocketUDT can be either
stream or message oriented, depending on TypeUDT
you must use SelectorProviderUDT.openServerSocketChannel() to obtain
instance of this class; do not use JDK
ServerSocketChannel.open();
example:
SelectorProvider provider = SelectorProviderUDT.DATAGRAM;
ServerSocketChannel acceptChannel = provider.openServerSocketChannel();
ServerSocket acceptSocket = acceptChannel.socket();
InetSocketAddress acceptAddress = new InetSocketAddress("localhost", 12345);
acceptorSocket.bind(acceptAddress);
assert acceptSocket.isBound();
SocketChannel connectChannel = acceptChannel.accept();
assert connectChannel.isConnected();
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Loggerprotected NioServerSocketUDTprotected final SocketUDT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedServerSocketChannelUDT(SelectorProviderUDT provider, SocketUDT socketUDT) -
Method Summary
Modifier and TypeMethodDescriptionaccept()bind(SocketAddress local, int backlog) <T> TgetOption(SocketOption<T> name) protected voidprotected voidimplConfigureBlocking(boolean block) booleanWas connection requestSocketChannelUDT.connect(java.net.SocketAddress)acknowledged bySocketChannelUDT.finishConnect()?kindUDT()The kind of UDT channel.UDT specific provider which produced this channel.setOption(SocketOption<T> name, T value) socket()Underlying UDT socket.Set<SocketOption<?>> toString()typeUDT()The type of UDT socket.Methods inherited from class java.nio.channels.ServerSocketChannel
bind, open, open, validOpsMethods inherited from class java.nio.channels.spi.AbstractSelectableChannel
blockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, registerMethods inherited from class java.nio.channels.SelectableChannel
registerMethods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.barchart.udt.nio.ChannelUDT
validOps
-
Field Details
-
log
protected static final org.slf4j.Logger log -
socketAdapter
-
socketUDT
-
-
Constructor Details
-
ServerSocketChannelUDT
-
-
Method Details
-
accept
- Specified by:
acceptin classServerSocketChannel- Throws:
IOException
-
implCloseSelectableChannel
- Specified by:
implCloseSelectableChannelin classAbstractSelectableChannel- Throws:
IOException
-
implConfigureBlocking
- Specified by:
implConfigureBlockingin classAbstractSelectableChannel- Throws:
IOException
-
isConnectFinished
public boolean isConnectFinished()Description copied from interface:ChannelUDTWas connection requestSocketChannelUDT.connect(java.net.SocketAddress)acknowledged bySocketChannelUDT.finishConnect()?- Specified by:
isConnectFinishedin interfaceChannelUDT
-
kindUDT
Description copied from interface:ChannelUDTThe kind of UDT channel.- Specified by:
kindUDTin interfaceChannelUDT
-
providerUDT
Description copied from interface:ChannelUDTUDT specific provider which produced this channel.- Specified by:
providerUDTin interfaceChannelUDT
-
socket
- Specified by:
socketin classServerSocketChannel
-
socketUDT
Description copied from interface:ChannelUDTUnderlying UDT socket.- Specified by:
socketUDTin interfaceChannelUDT
-
toString
-
typeUDT
Description copied from interface:ChannelUDTThe type of UDT socket.- Specified by:
typeUDTin interfaceChannelUDT
-
getLocalAddress
- Specified by:
getLocalAddressin interfaceNetworkChannel- Specified by:
getLocalAddressin classServerSocketChannel- Throws:
IOException
-
supportedOptions
- Specified by:
supportedOptionsin interfaceNetworkChannel
-
getOption
- Specified by:
getOptionin interfaceNetworkChannel- Throws:
IOException
-
setOption
- Specified by:
setOptionin interfaceNetworkChannel- Specified by:
setOptionin classServerSocketChannel- Throws:
IOException
-
bind
- Specified by:
bindin classServerSocketChannel- Throws:
IOException
-