public class UnixDomainSocket extends Socket implements Transport
Socket backed by a native Unix domain socket.
Instances of this class always return null for Socket.getInetAddress(), Socket.getLocalAddress(), Socket.getLocalSocketAddress(), Socket.getRemoteSocketAddress().
If not explicitly closed, will close the file descriptor when finalized.
Caller is responsible for closing the streams returned from getInputStream() and
getOutputStream().
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static UnixDomainSocket |
createSocketWithPath(Path path)
Creates a Unix domain socket bound to a path.
|
protected void |
finalize() |
InputStream |
getInputStream()
Returns an input stream for reading messages
|
OutputStream |
getOutputStream()
Returns an input stream for writing messages.
|
boolean |
isConnected() |
void |
shutdownInput() |
void |
shutdownOutput() |
bind, connect, connect, getChannel, getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, toStringpublic static UnixDomainSocket createSocketWithPath(Path path) throws IOException
IOExceptionpublic boolean isConnected()
isConnected in class Socketpublic InputStream getInputStream()
TransportgetInputStream in interface TransportgetInputStream in class Socketpublic OutputStream getOutputStream()
TransportgetOutputStream in interface TransportgetOutputStream in class Socketpublic void shutdownInput()
throws IOException
shutdownInput in class SocketIOExceptionpublic void shutdownOutput()
throws IOException
shutdownOutput in class SocketIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class SocketIOExceptionprotected void finalize()
throws IOException
finalize in class ObjectIOException