Class UnixDomainSocket
- java.lang.Object
-
- java.net.Socket
-
- org.mariadb.jdbc.internal.io.socket.UnixDomainSocket
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class UnixDomainSocket extends java.net.Socket
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UnixDomainSocket.SockAddr
(package private) class
UnixDomainSocket.UnixSocketInputStream
(package private) class
UnixDomainSocket.UnixSocketOutputStream
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description UnixDomainSocket(java.lang.String path)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
Methods inherited from class java.net.Socket
bind, getChannel, getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getOption, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isInputShutdown, isOutputShutdown, sendUrgentData, setOOBInline, setOption, setPerformancePreferences, setReuseAddress, setSocketImplFactory, setTrafficClass, supportedOptions, toString
-
-
-
-
Field Detail
-
AF_UNIX
private static final int AF_UNIX
- See Also:
- Constant Field Values
-
SOCK_STREAM
private static final int SOCK_STREAM
-
PROTOCOL
private static final int PROTOCOL
- See Also:
- Constant Field Values
-
closeLock
private final java.util.concurrent.atomic.AtomicBoolean closeLock
-
sockaddr
private final UnixDomainSocket.SockAddr sockaddr
-
fd
private final int fd
-
is
private java.io.InputStream is
-
os
private java.io.OutputStream os
-
connected
private boolean connected
-
-
Method Detail
-
socket
public static int socket(int domain, int type, int protocol) throws com.sun.jna.LastErrorException
- Throws:
com.sun.jna.LastErrorException
-
connect
public static int connect(int sockfd, UnixDomainSocket.SockAddr sockaddr, int addrlen) throws com.sun.jna.LastErrorException
- Throws:
com.sun.jna.LastErrorException
-
recv
public static int recv(int fd, byte[] buffer, int count, int flags) throws com.sun.jna.LastErrorException
- Throws:
com.sun.jna.LastErrorException
-
send
public static int send(int fd, byte[] buffer, int count, int flags) throws com.sun.jna.LastErrorException
- Throws:
com.sun.jna.LastErrorException
-
close
public static int close(int fd) throws com.sun.jna.LastErrorException
- Throws:
com.sun.jna.LastErrorException
-
strerror
public static java.lang.String strerror(int errno)
-
formatError
private static java.lang.String formatError(com.sun.jna.LastErrorException lee)
-
isConnected
public boolean isConnected()
- Overrides:
isConnected
in classjava.net.Socket
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.net.Socket
- Throws:
java.io.IOException
-
connect
public void connect(java.net.SocketAddress endpoint) throws java.io.IOException
- Overrides:
connect
in classjava.net.Socket
- Throws:
java.io.IOException
-
connect
public void connect(java.net.SocketAddress endpoint, int timeout) throws java.io.IOException
- Overrides:
connect
in classjava.net.Socket
- Throws:
java.io.IOException
-
getInputStream
public java.io.InputStream getInputStream()
- Overrides:
getInputStream
in classjava.net.Socket
-
getOutputStream
public java.io.OutputStream getOutputStream()
- Overrides:
getOutputStream
in classjava.net.Socket
-
setTcpNoDelay
public void setTcpNoDelay(boolean b)
- Overrides:
setTcpNoDelay
in classjava.net.Socket
-
setKeepAlive
public void setKeepAlive(boolean b)
- Overrides:
setKeepAlive
in classjava.net.Socket
-
setReceiveBufferSize
public void setReceiveBufferSize(int size)
- Overrides:
setReceiveBufferSize
in classjava.net.Socket
-
setSendBufferSize
public void setSendBufferSize(int size)
- Overrides:
setSendBufferSize
in classjava.net.Socket
-
setSoLinger
public void setSoLinger(boolean b, int i)
- Overrides:
setSoLinger
in classjava.net.Socket
-
setSoTimeout
public void setSoTimeout(int timeout)
- Overrides:
setSoTimeout
in classjava.net.Socket
-
shutdownInput
public void shutdownInput()
- Overrides:
shutdownInput
in classjava.net.Socket
-
shutdownOutput
public void shutdownOutput()
- Overrides:
shutdownOutput
in classjava.net.Socket
-
-