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, toString
protected static final int PF_LOCAL
protected static final byte AF_LOCAL
protected static final int SOCK_STREAM
public void write(ByteBuffer buffer) throws IOException
IOException
public InputStream getInputStream()
getInputStream
in class Socket
public OutputStream getOutputStream()
getOutputStream
in class Socket
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Socket
IOException
protected 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 Socket
IOException
public void connect(SocketAddress endpoint, int timeout) throws IOException
connect
in class Socket
IOException
public boolean isConnected()
isConnected
in class Socket
public void shutdownInput() throws IOException
shutdownInput
in class Socket
IOException
public void shutdownOutput() throws IOException
shutdownOutput
in class Socket
IOException
public InetAddress getInetAddress()
getInetAddress
in class Socket
public InetAddress getLocalAddress()
getLocalAddress
in class Socket
public SocketAddress getLocalSocketAddress()
getLocalSocketAddress
in class Socket
public SocketAddress getRemoteSocketAddress()
getRemoteSocketAddress
in class Socket