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
public class NioServerSocketUDT
- extends NetServerSocketUDT
| Methods inherited from class com.barchart.udt.net.NetServerSocketUDT |
bind, close, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, isBound, isClosed, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSoTimeout, socketUDT |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
channelUDT
protected final ServerSocketChannelUDT channelUDT
NioServerSocketUDT
protected NioServerSocketUDT(ServerSocketChannelUDT channelUDT)
throws IOException
- Throws:
IOException
accept
public Socket accept()
throws IOException
- Description copied from interface:
IceServerSocket
- Listens for a connection to be made to this socket and accepts it. The
method blocks until a connection is made.
A new Socket s is created and, if there is a security
manager, the security manager's checkAccept method is called
with s.getInetAddress().getHostAddress() and
s.getPort() as its arguments to ensure the operation is
allowed. This could result in a SecurityException.
- Specified by:
accept in interface IceServerSocket- Overrides:
accept in class NetServerSocketUDT
- Returns:
- the new Socket
- Throws:
IOException - if an I/O error occurs when waiting for a connection.
SocketTimeoutException - if a timeout was previously set with setSoTimeout and the
timeout has been reached.- See Also:
revised 1.4 spec JSR-51
bind
public void bind(SocketAddress endpoint)
throws IOException
- Description copied from interface:
IceServerSocket
- Binds the
ServerSocket to 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:
bind in interface IceServerSocket- Overrides:
bind in class NetServerSocketUDT
- Parameters:
endpoint - The IP address & port number to bind to.
- Throws:
IOException - if the bind operation fails, or if the socket is already
bound.
getChannel
public ServerSocketChannelUDT getChannel()
- Description copied from interface:
IceServerSocket
- Returns the unique
ServerSocketChannel object
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.open method.
- Specified by:
getChannel in interface IceServerSocket- Overrides:
getChannel in class NetServerSocketUDT
- Returns:
- the server-socket channel associated with this socket, or
null if this socket was not created for a channel
Copyright © 2009-2013 Barchart, Inc.. All Rights Reserved.