Class UnixServerSocket
java.lang.Object
cx.ath.matthew.unix.UnixServerSocket
Represents a listening UNIX Socket.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate 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
Modifier and TypeMethodDescriptionaccept()Accepts a connection on the ServerSocket.voidbind(UnixSocketAddress address) Binds a server socket to the given address.voidBinds a server socket to the given address.voidclose()Closes the ServerSocket.Return the address this socket is bound to.booleanisBound()Check the status of the socket.booleanisClosed()Check the status of the socket.
-
Constructor Details
-
UnixServerSocket
public UnixServerSocket()Create an un-bound server socket. -
UnixServerSocket
Create a server socket bound to the given address.- Parameters:
address- Path to the socket.- Throws:
IOException
-
UnixServerSocket
Create a server socket bound to the given address.- Parameters:
address- Path to the socket.- Throws:
IOException
-
-
Method Details
-
accept
Accepts a connection on the ServerSocket.- Returns:
- A UnixSocket connected to the accepted connection.
- Throws:
IOException
-
close
-
bind
Binds a server socket to the given address.- Parameters:
address- Path to the socket.- Throws:
IOException
-
bind
Binds a server socket to the given address.- Parameters:
address- Path to the socket.- Throws:
IOException
-
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.
-