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, toString
public static UnixDomainSocket createSocketWithPath(Path path) throws IOException
IOException
public boolean isConnected()
isConnected
in class Socket
public InputStream getInputStream()
Transport
getInputStream
in interface Transport
getInputStream
in class Socket
public OutputStream getOutputStream()
Transport
getOutputStream
in interface Transport
getOutputStream
in class Socket
public void shutdownInput() throws IOException
shutdownInput
in class Socket
IOException
public void shutdownOutput() throws IOException
shutdownOutput
in class Socket
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Socket
IOException
protected void finalize() throws IOException
finalize
in class Object
IOException