cx.ath.matthew.unix
Class UnixServerSocket

java.lang.Object
  extended by cx.ath.matthew.unix.UnixServerSocket

public class UnixServerSocket
extends Object

Represents a listening UNIX Socket.


Constructor Summary
UnixServerSocket()
          Create an un-bound server socket.
UnixServerSocket(String address)
          Create a server socket bound to the given address.
UnixServerSocket(UnixSocketAddress address)
          Create a server socket bound to the given address.
 
Method Summary
 UnixSocket accept()
          Accepts a connection on the ServerSocket.
 void bind(String address)
          Binds a server socket to the given address.
 void bind(UnixSocketAddress address)
          Binds a server socket to the given address.
 void close()
          Closes the ServerSocket.
 UnixSocketAddress getAddress()
          Return the address this socket is bound to.
 boolean isBound()
          Check the status of the socket.
 boolean isClosed()
          Check the status of the socket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnixServerSocket

public UnixServerSocket()
Create an un-bound server socket.


UnixServerSocket

public UnixServerSocket(UnixSocketAddress address)
                 throws IOException
Create a server socket bound to the given address.

Parameters:
address - Path to the socket.
Throws:
IOException

UnixServerSocket

public UnixServerSocket(String address)
                 throws IOException
Create a server socket bound to the given address.

Parameters:
address - Path to the socket.
Throws:
IOException
Method Detail

accept

public UnixSocket accept()
                  throws IOException
Accepts a connection on the ServerSocket.

Returns:
A UnixSocket connected to the accepted connection.
Throws:
IOException

close

public void close()
           throws IOException
Closes the ServerSocket.

Throws:
IOException

bind

public void bind(UnixSocketAddress address)
          throws IOException
Binds a server socket to the given address.

Parameters:
address - Path to the socket.
Throws:
IOException

bind

public void bind(String address)
          throws IOException
Binds a server socket to the given address.

Parameters:
address - Path to the socket.
Throws:
IOException

getAddress

public UnixSocketAddress getAddress()
Return the address this socket is bound to.

Returns:
The UnixSocketAddress if bound or null if unbound.

isClosed

public boolean isClosed()
Check the status of the socket.

Returns:
True if closed.

isBound

public boolean isBound()
Check the status of the socket.

Returns:
True if bound.