cx.ath.matthew.unix

Class UnixServerSocket

public class UnixServerSocket extends Object

Represents a listening UNIX Socket.
Constructor Summary
UnixServerSocket()
Create an un-bound server socket.
UnixServerSocket(UnixSocketAddress address)
Create a server socket bound to the given address.
UnixServerSocket(String address)
Create a server socket bound to the given address.
Method Summary
UnixSocketaccept()
Accepts a connection on the ServerSocket.
voidbind(UnixSocketAddress address)
Binds a server socket to the given address.
voidbind(String address)
Binds a server socket to the given address.
voidclose()
Closes the ServerSocket.
UnixSocketAddressgetAddress()
Return the address this socket is bound to.
booleanisBound()
Check the status of the socket.
booleanisClosed()
Check the status of the socket.

Constructor Detail

UnixServerSocket

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

UnixServerSocket

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

Parameters: address Path to the socket.

UnixServerSocket

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

Parameters: address Path to the socket.

Method Detail

accept

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

Returns: A UnixSocket connected to the accepted connection.

bind

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

Parameters: address Path to the socket.

bind

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

Parameters: address Path to the socket.

close

public void close()
Closes the ServerSocket.

getAddress

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

Returns: The UnixSocketAddress if bound or null if unbound.

isBound

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

Returns: True if bound.

isClosed

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

Returns: True if closed.