naga
Interface NIOAbstractSocket

All Known Subinterfaces:
NIOServerSocket, NIOSocket

public interface NIOAbstractSocket

An interface describing methods common to both NIOSocket and NIOServerSocket.

Author:
Christoffer Lerno

Method Summary
 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.
 boolean isOpen()
          Returns the current state of 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.