public class UnixDomainSocket extends Socket
| Modifier and Type | Class and Description |
|---|---|
static class |
UnixDomainSocket.SockAddr |
| Constructor and Description |
|---|
UnixDomainSocket(String path)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static int |
close(int fd)
Close socket
|
static int |
connect(int sockfd,
UnixDomainSocket.SockAddr sockaddr,
int addrlen)
Connect socket
|
void |
connect(SocketAddress endpoint,
int timeout) |
InputStream |
getInputStream() |
OutputStream |
getOutputStream() |
boolean |
isConnected() |
static int |
recv(int fd,
byte[] buffer,
int count,
int flags)
Receive a message from a socket
|
static int |
send(int fd,
byte[] buffer,
int count,
int flags)
Send a message to a socket
|
void |
setKeepAlive(boolean b) |
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)
creates an endpoint for communication and returns a file descriptor that refers to that
endpoint.
|
static String |
strerror(int errno)
return a description of the error code passed in the argument errnum.
|
bind, connect, getChannel, getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isInputShutdown, isOutputShutdown, sendUrgentData, setOOBInline, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setTrafficClass, toStringpublic UnixDomainSocket(String path) throws IOException
path - unix pathIOException - if any error occurspublic static int socket(int domain,
int type,
int protocol)
throws com.sun.jna.LastErrorException
domain - domaintype - typeprotocol - protocolcom.sun.jna.LastErrorException - if any error occurspublic static int connect(int sockfd,
UnixDomainSocket.SockAddr sockaddr,
int addrlen)
throws com.sun.jna.LastErrorException
sockfd - file descriptorsockaddr - socket addressaddrlen - address lengthcom.sun.jna.LastErrorException - if error occurspublic static int recv(int fd,
byte[] buffer,
int count,
int flags)
throws com.sun.jna.LastErrorException
fd - file descriptorbuffer - buffercount - lengthflags - flag.com.sun.jna.LastErrorException - if error occurspublic static int send(int fd,
byte[] buffer,
int count,
int flags)
throws com.sun.jna.LastErrorException
fd - file descriptorbuffer - buffercount - lengthflags - flag.com.sun.jna.LastErrorException - if error occurspublic static int close(int fd)
throws com.sun.jna.LastErrorException
fd - file descriptorcom.sun.jna.LastErrorException - if error occurspublic static String strerror(int errno)
errno - error pointerpublic boolean isConnected()
isConnected in class Socketpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class SocketIOExceptionpublic void connect(SocketAddress endpoint, int timeout) throws IOException
connect in class SocketIOExceptionpublic InputStream getInputStream()
getInputStream in class Socketpublic OutputStream getOutputStream()
getOutputStream in class Socketpublic void setTcpNoDelay(boolean b)
setTcpNoDelay in class Socketpublic void setKeepAlive(boolean b)
setKeepAlive in class Socketpublic void setSoLinger(boolean b,
int i)
setSoLinger in class Socketpublic void setSoTimeout(int timeout)
setSoTimeout in class Socketpublic void shutdownInput()
shutdownInput in class Socketpublic void shutdownOutput()
shutdownOutput in class SocketCopyright © 2025 SingleStore. All rights reserved.