public abstract class DomainSocket extends Socket
Socket implementation for Linux of BSD domain sockets.| Modifier and Type | Field and Description |
|---|---|
protected static byte |
AF_LOCAL |
protected static int |
PF_LOCAL |
protected static int |
SOCK_STREAM |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
connect(SocketAddress endpoint) |
void |
connect(SocketAddress endpoint,
int timeout) |
protected abstract void |
connect(String path,
int handle) |
static DomainSocket |
get(String path)
Return a new
DomainSocket for the given path. |
InetAddress |
getInetAddress() |
InputStream |
getInputStream() |
InetAddress |
getLocalAddress() |
SocketAddress |
getLocalSocketAddress() |
OutputStream |
getOutputStream() |
SocketAddress |
getRemoteSocketAddress() |
boolean |
isBound() |
boolean |
isConnected() |
void |
shutdownInput() |
void |
shutdownOutput() |
void |
write(ByteBuffer buffer) |
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, toStringprotected static final int PF_LOCAL
protected static final byte AF_LOCAL
protected static final int SOCK_STREAM
public void write(ByteBuffer buffer) throws IOException
IOExceptionpublic InputStream getInputStream()
getInputStream in class Socketpublic OutputStream getOutputStream()
getOutputStream in class Socketpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class SocketIOExceptionprotected abstract void connect(String path, int handle)
public static DomainSocket get(String path) throws IOException
DomainSocket for the given path.path - the path to the domain socketDomainSocket instanceIOException - if the socket cannot be openedpublic 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 Socketpublic SocketAddress getLocalSocketAddress()
getLocalSocketAddress in class Socketpublic SocketAddress getRemoteSocketAddress()
getRemoteSocketAddress in class Socket