Package com.barchart.udt.nio
Class NioServerSocketUDT
java.lang.Object
java.net.ServerSocket
com.barchart.udt.net.NetServerSocketUDT
com.barchart.udt.nio.NioServerSocketUDT
- All Implemented Interfaces:
IceCommon,IceServerSocket,Closeable,AutoCloseable
-
Field Summary
FieldsFields inherited from class com.barchart.udt.net.NetServerSocketUDT
socketUDT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccept()Listens for a connection to be made to this socket and accepts it.voidbind(SocketAddress endpoint) Binds theServerSocketto a specific address (IP address and port number).Returns the uniqueServerSocketChannelobject associated with this socket, if any.Methods inherited from class com.barchart.udt.net.NetServerSocketUDT
bind, close, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, isBound, isClosed, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSoTimeout, socketUDTMethods inherited from class java.net.ServerSocket
getOption, implAccept, setOption, setSocketFactory, supportedOptions, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.barchart.udt.net.IceServerSocket
toString
-
Field Details
-
channelUDT
-
-
Constructor Details
-
NioServerSocketUDT
- Throws:
IOException
-
-
Method Details
-
accept
Description copied from interface:IceServerSocketListens for a connection to be made to this socket and accepts it. The method blocks until a connection is made.A new Socket
sis created and, if there is a security manager, the security manager'scheckAcceptmethod is called withs.getInetAddress().getHostAddress()ands.getPort()as its arguments to ensure the operation is allowed. This could result in a SecurityException.- Specified by:
acceptin interfaceIceServerSocket- Overrides:
acceptin classNetServerSocketUDT- Returns:
- the new Socket
- Throws:
IOException- if an I/O error occurs when waiting for a connection.- See Also:
-
bind
Description copied from interface:IceServerSocketBinds theServerSocketto a specific address (IP address and port number).If the address is
null, then the system will pick up an ephemeral port and a valid local address to bind the socket.- Specified by:
bindin interfaceIceServerSocket- Overrides:
bindin classNetServerSocketUDT- Parameters:
endpoint- The IP address invalid input: '&' port number to bind to.- Throws:
IOException- if the bind operation fails, or if the socket is already bound.
-
getChannel
Description copied from interface:IceServerSocketReturns the uniqueServerSocketChannelobject associated with this socket, if any.A server socket will have a channel if, and only if, the channel itself was created via the
ServerSocketChannel.openmethod.- Specified by:
getChannelin interfaceIceServerSocket- Overrides:
getChannelin classNetServerSocketUDT- Returns:
- the server-socket channel associated with this socket, or null if this socket was not created for a channel
-