public class UnixDomainSocket
extends java.net.Socket
| Modifier and Type | Class and Description |
|---|---|
static class |
UnixDomainSocket.SockAddr |
(package private) class |
UnixDomainSocket.UnixSocketInputStream |
(package private) class |
UnixDomainSocket.UnixSocketOutputStream |
| Modifier and Type | Field and Description |
|---|---|
private static int |
AF_UNIX |
private java.util.concurrent.atomic.AtomicBoolean |
closeLock |
private boolean |
connected |
private int |
fd |
private java.io.InputStream |
is |
private java.io.OutputStream |
os |
private static int |
PROTOCOL |
private static int |
SOCK_STREAM |
private UnixDomainSocket.SockAddr |
sockaddr |
| Constructor and Description |
|---|
UnixDomainSocket(java.lang.String path) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static int |
close(int fd) |
static int |
connect(int sockfd,
UnixDomainSocket.SockAddr sockaddr,
int addrlen) |
void |
connect(java.net.SocketAddress endpoint) |
void |
connect(java.net.SocketAddress endpoint,
int timeout) |
private static java.lang.String |
formatError(com.sun.jna.LastErrorException lee) |
java.io.InputStream |
getInputStream() |
java.io.OutputStream |
getOutputStream() |
boolean |
isConnected() |
static int |
recv(int fd,
byte[] buffer,
int count,
int flags) |
static int |
send(int fd,
byte[] buffer,
int count,
int flags) |
void |
setKeepAlive(boolean b) |
void |
setReceiveBufferSize(int size) |
void |
setSendBufferSize(int size) |
void |
setSoLinger(boolean b,
int i) |
void |
setSoTimeout(int timeout) |
void |
setTcpNoDelay(boolean b) |
void |
shutdownInput() |
void |
shutdownOutput() |
static int |
socket(int domain,
int type,
int protocol) |
static java.lang.String |
strerror(int errno) |
bind, getChannel, getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isInputShutdown, isOutputShutdown, sendUrgentData, setOOBInline, setPerformancePreferences, setReuseAddress, setSocketImplFactory, setTrafficClass, toStringprivate static final int AF_UNIX
private static final int SOCK_STREAM
private static final int PROTOCOL
private final java.util.concurrent.atomic.AtomicBoolean closeLock
private final UnixDomainSocket.SockAddr sockaddr
private final int fd
private java.io.InputStream is
private java.io.OutputStream os
private boolean connected
public UnixDomainSocket(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic static int socket(int domain,
int type,
int protocol)
throws com.sun.jna.LastErrorException
com.sun.jna.LastErrorExceptionpublic static int connect(int sockfd,
UnixDomainSocket.SockAddr sockaddr,
int addrlen)
throws com.sun.jna.LastErrorException
com.sun.jna.LastErrorExceptionpublic static int recv(int fd,
byte[] buffer,
int count,
int flags)
throws com.sun.jna.LastErrorException
com.sun.jna.LastErrorExceptionpublic static int send(int fd,
byte[] buffer,
int count,
int flags)
throws com.sun.jna.LastErrorException
com.sun.jna.LastErrorExceptionpublic static int close(int fd)
throws com.sun.jna.LastErrorException
com.sun.jna.LastErrorExceptionpublic static java.lang.String strerror(int errno)
private static java.lang.String formatError(com.sun.jna.LastErrorException lee)
public boolean isConnected()
isConnected in class java.net.Socketpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.net.Socketjava.io.IOExceptionpublic void connect(java.net.SocketAddress endpoint)
throws java.io.IOException
connect in class java.net.Socketjava.io.IOExceptionpublic void connect(java.net.SocketAddress endpoint,
int timeout)
throws java.io.IOException
connect in class java.net.Socketjava.io.IOExceptionpublic java.io.InputStream getInputStream()
getInputStream in class java.net.Socketpublic java.io.OutputStream getOutputStream()
getOutputStream in class java.net.Socketpublic void setTcpNoDelay(boolean b)
setTcpNoDelay in class java.net.Socketpublic void setKeepAlive(boolean b)
setKeepAlive in class java.net.Socketpublic void setReceiveBufferSize(int size)
setReceiveBufferSize in class java.net.Socketpublic void setSendBufferSize(int size)
setSendBufferSize in class java.net.Socketpublic void setSoLinger(boolean b,
int i)
setSoLinger in class java.net.Socketpublic void setSoTimeout(int timeout)
setSoTimeout in class java.net.Socketpublic void shutdownInput()
shutdownInput in class java.net.Socketpublic void shutdownOutput()
shutdownOutput in class java.net.Socket