public class UnixSocket extends Socket
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
connect(SocketAddress endpoint) |
void |
connect(SocketAddress endpoint,
int timeout) |
static Socket |
get(String path)
Return a new
Socket for the given path. |
InetAddress |
getInetAddress() |
InputStream |
getInputStream() |
InetAddress |
getLocalAddress() |
SocketAddress |
getLocalSocketAddress() |
OutputStream |
getOutputStream() |
SocketAddress |
getRemoteSocketAddress() |
boolean |
isBound() |
boolean |
isConnected() |
void |
shutdownInput() |
void |
shutdownOutput() |
bind, getChannel, getKeepAlive, getLocalPort, getOOBInline, getPort, getReceiveBufferSize, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isClosed, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, toStringpublic static Socket get(String path) throws IOException
Socket for the given path. Will use JDK's UnixDomainSocketAddress
if available and fallback to DomainSocket otherwise.path - the path to the domain socketSocket instanceIOException - if the socket cannot be openedpublic InputStream getInputStream() throws IOException
getInputStream in class SocketIOExceptionpublic OutputStream getOutputStream() throws IOException
getOutputStream in class SocketIOExceptionpublic SocketAddress getLocalSocketAddress()
public SocketAddress getRemoteSocketAddress()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class SocketIOExceptionpublic void connect(SocketAddress endpoint) throws IOException
connect in class SocketIOExceptionpublic void connect(SocketAddress endpoint, int timeout) throws IOException
connect in class SocketIOExceptionpublic boolean isConnected()
isConnected in class Socketpublic void shutdownInput()
throws IOException
shutdownInput in class SocketIOExceptionpublic void shutdownOutput()
throws IOException
shutdownOutput in class SocketIOExceptionpublic InetAddress getInetAddress()
getInetAddress in class Socketpublic InetAddress getLocalAddress()
getLocalAddress in class SocketCopyright © 2025. All rights reserved.