Class NioServerSocketUDT

All Implemented Interfaces:
IceCommon, IceServerSocket, Closeable, AutoCloseable

public class NioServerSocketUDT extends NetServerSocketUDT
  • Field Details

  • Constructor Details

  • Method Details

    • 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.
      See Also:
    • 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 invalid input: '&' 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