NIOAbstractSocket (Naga API)
Date: 2016-06-28

naga

## Interface NIOAbstractSocket

- All Known Subinterfaces:
    NIOServerSocket, NIOServerSocketSSL, NIOSocket, NIOSocketSSL

      public interface NIOAbstractSocket

  An interface describing methods common to both NIOSocket and NIOServerSocket.
  Author:
    Christoffer Lerno

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes this socket (the actual disconnect will occur on the NIOService thread)
    `java.net.InetSocketAddress` | `getAddress()` Returns the InetSocketAddress for this socket.
    `java.lang.String` | `getIp()` Reports the IP used by this socket.
    `int` | `getPort()` Returns the port in use by this socket.
    `java.lang.Object` | `getTag()` Returns the tag for this socket.
    `boolean` | `isOpen()` Returns the current state of this socket.
    `void` | `setTag(java.lang.Object tag)` Returns the tag for this socket.

- - ### Method Detail

    - #### close

          void close()

      Closes this socket (the actual disconnect will occur on the NIOService thread)

      This method is thread-safe.

    - #### getAddress

          java.net.InetSocketAddress getAddress()

      Returns the InetSocketAddress for this socket.

      This method is thread-safe.

      Returns:
        the InetSocketAddress this socket connects to.

    - #### isOpen

          boolean isOpen()

      Returns the current state of this socket.

      This method is thread-safe.

      Returns:
        true if the connection is socket is open, false if closed.

    - #### getIp

          java.lang.String getIp()

      Reports the IP used by this socket.

      This method is thread-safe.

      Returns:
        the IP of this socket.

    - #### getPort

          int getPort()

      Returns the port in use by this socket.

      This method is thread-safe.

      Returns:
        the port of this socket.

    - #### getTag

          java.lang.Object getTag()

      Returns the tag for this socket.
      Returns:
        the tag or null if no tag has been set.

    - #### setTag

          void setTag(java.lang.Object tag)

      Returns the tag for this socket. A tag is an object that you can associate with the socket and retrieve later.
      Parameters:
        `tag` - the new tag for this socket.