public final class Socket extends FileDescriptor
Modifier and Type | Field and Description |
---|---|
private static Errors.NativeConnectException |
CONNECT_REFUSED_EXCEPTION |
private static Errors.NativeIoException |
CONNECTION_RESET_EXCEPTION_SENDMSG |
private static Errors.NativeIoException |
CONNECTION_RESET_SHUTDOWN_EXCEPTION |
private static Errors.NativeConnectException |
FINISH_CONNECT_REFUSED_EXCEPTION |
private static java.nio.channels.ClosedChannelException |
SEND_TO_ADDRESS_CLOSED_CHANNEL_EXCEPTION |
private static Errors.NativeIoException |
SEND_TO_ADDRESS_CONNECTION_RESET_EXCEPTION |
private static java.nio.channels.ClosedChannelException |
SEND_TO_ADDRESSES_CLOSED_CHANNEL_EXCEPTION |
private static java.nio.channels.ClosedChannelException |
SEND_TO_CLOSED_CHANNEL_EXCEPTION |
private static Errors.NativeIoException |
SEND_TO_CONNECTION_RESET_EXCEPTION |
private static java.nio.channels.ClosedChannelException |
SHUTDOWN_CLOSED_CHANNEL_EXCEPTION |
fd, state
Constructor and Description |
---|
Socket(int fd) |
Modifier and Type | Method and Description |
---|---|
int |
accept(byte[] addr) |
private static int |
accept(int fd,
byte[] addr) |
private static int |
bind(int fd,
byte[] address,
int scopeId,
int port) |
void |
bind(java.net.SocketAddress socketAddress) |
private static int |
bindDomainSocket(int fd,
byte[] path) |
private static int |
connect(int fd,
byte[] address,
int scopeId,
int port) |
boolean |
connect(java.net.SocketAddress socketAddress) |
private static int |
connectDomainSocket(int fd,
byte[] path) |
boolean |
finishConnect() |
private static int |
finishConnect(int fd) |
int |
getReceiveBufferSize() |
private static int |
getReceiveBufferSize(int fd) |
int |
getSendBufferSize() |
private static int |
getSendBufferSize(int fd) |
int |
getSoError() |
private static int |
getSoError(int fd) |
int |
getSoLinger() |
private static int |
getSoLinger(int fd) |
int |
getTcpDeferAccept() |
private static int |
getTcpDeferAccept(int fd) |
boolean |
isInputShutdown() |
boolean |
isKeepAlive() |
private static int |
isKeepAlive(int fd) |
boolean |
isOutputShutdown() |
boolean |
isShutdown() |
boolean |
isTcpCork() |
private static int |
isTcpCork(int fd) |
boolean |
isTcpNoDelay() |
private static int |
isTcpNoDelay(int fd) |
boolean |
isTcpQuickAck() |
private static int |
isTcpQuickAck(int fd) |
void |
listen(int backlog) |
private static int |
listen(int fd,
int backlog) |
java.net.InetSocketAddress |
localAddress() |
private static byte[] |
localAddress(int fd) |
static Socket |
newSocketDgram() |
private static int |
newSocketDgramFd() |
static Socket |
newSocketDomain() |
private static int |
newSocketDomainFd() |
static Socket |
newSocketStream() |
private static int |
newSocketStreamFd() |
DatagramSocketAddress |
recvFrom(java.nio.ByteBuffer buf,
int pos,
int limit) |
private static DatagramSocketAddress |
recvFrom(int fd,
java.nio.ByteBuffer buf,
int pos,
int limit) |
private static DatagramSocketAddress |
recvFromAddress(int fd,
long memoryAddress,
int pos,
int limit) |
DatagramSocketAddress |
recvFromAddress(long memoryAddress,
int pos,
int limit) |
java.net.InetSocketAddress |
remoteAddress() |
private static byte[] |
remoteAddress(int fd) |
int |
sendTo(java.nio.ByteBuffer buf,
int pos,
int limit,
java.net.InetAddress addr,
int port) |
private static int |
sendTo(int fd,
java.nio.ByteBuffer buf,
int pos,
int limit,
byte[] address,
int scopeId,
int port) |
private static int |
sendToAddress(int fd,
long memoryAddress,
int pos,
int limit,
byte[] address,
int scopeId,
int port) |
int |
sendToAddress(long memoryAddress,
int pos,
int limit,
java.net.InetAddress addr,
int port) |
private static int |
sendToAddresses(int fd,
long memoryAddress,
int length,
byte[] address,
int scopeId,
int port) |
int |
sendToAddresses(long memoryAddress,
int length,
java.net.InetAddress addr,
int port) |
void |
setKeepAlive(boolean keepAlive) |
private static void |
setKeepAlive(int fd,
int keepAlive) |
void |
setReceiveBufferSize(int receiveBufferSize) |
private static void |
setReceiveBufferSize(int fd,
int receiveBufferSize) |
void |
setSendBufferSize(int sendBufferSize) |
private static void |
setSendBufferSize(int fd,
int sendBufferSize) |
void |
setSoLinger(int soLinger) |
private static void |
setSoLinger(int fd,
int soLinger) |
void |
setTcpCork(boolean tcpCork) |
private static void |
setTcpCork(int fd,
int tcpCork) |
void |
setTcpDeferAccept(int deferAccept) |
private static void |
setTcpDeferAccept(int fd,
int deferAccept) |
void |
setTcpNoDelay(boolean tcpNoDelay) |
private static void |
setTcpNoDelay(int fd,
int tcpNoDelay) |
void |
setTcpQuickAck(boolean quickAck) |
private static void |
setTcpQuickAck(int fd,
int quickAck) |
void |
shutdown() |
void |
shutdown(boolean read,
boolean write) |
private static int |
shutdown(int fd,
boolean read,
boolean write) |
java.lang.String |
toString() |
casState, close, equals, from, from, hashCode, inputShutdown, intValue, isClosed, isInputShutdown, isOpen, isOutputShutdown, outputShutdown, pipe, read, readAddress, write, writeAddress, writev, writevAddresses
private static final java.nio.channels.ClosedChannelException SHUTDOWN_CLOSED_CHANNEL_EXCEPTION
private static final java.nio.channels.ClosedChannelException SEND_TO_CLOSED_CHANNEL_EXCEPTION
private static final java.nio.channels.ClosedChannelException SEND_TO_ADDRESS_CLOSED_CHANNEL_EXCEPTION
private static final java.nio.channels.ClosedChannelException SEND_TO_ADDRESSES_CLOSED_CHANNEL_EXCEPTION
private static final Errors.NativeIoException SEND_TO_CONNECTION_RESET_EXCEPTION
private static final Errors.NativeIoException SEND_TO_ADDRESS_CONNECTION_RESET_EXCEPTION
private static final Errors.NativeIoException CONNECTION_RESET_EXCEPTION_SENDMSG
private static final Errors.NativeIoException CONNECTION_RESET_SHUTDOWN_EXCEPTION
private static final Errors.NativeConnectException FINISH_CONNECT_REFUSED_EXCEPTION
private static final Errors.NativeConnectException CONNECT_REFUSED_EXCEPTION
public void shutdown() throws java.io.IOException
java.io.IOException
public void shutdown(boolean read, boolean write) throws java.io.IOException
java.io.IOException
public boolean isShutdown()
public boolean isInputShutdown()
public boolean isOutputShutdown()
public int sendTo(java.nio.ByteBuffer buf, int pos, int limit, java.net.InetAddress addr, int port) throws java.io.IOException
java.io.IOException
public int sendToAddress(long memoryAddress, int pos, int limit, java.net.InetAddress addr, int port) throws java.io.IOException
java.io.IOException
public int sendToAddresses(long memoryAddress, int length, java.net.InetAddress addr, int port) throws java.io.IOException
java.io.IOException
public DatagramSocketAddress recvFrom(java.nio.ByteBuffer buf, int pos, int limit) throws java.io.IOException
java.io.IOException
public DatagramSocketAddress recvFromAddress(long memoryAddress, int pos, int limit) throws java.io.IOException
java.io.IOException
public boolean connect(java.net.SocketAddress socketAddress) throws java.io.IOException
java.io.IOException
public boolean finishConnect() throws java.io.IOException
java.io.IOException
public void bind(java.net.SocketAddress socketAddress) throws java.io.IOException
java.io.IOException
public void listen(int backlog) throws java.io.IOException
java.io.IOException
public int accept(byte[] addr) throws java.io.IOException
java.io.IOException
public java.net.InetSocketAddress remoteAddress()
public java.net.InetSocketAddress localAddress()
public int getReceiveBufferSize() throws java.io.IOException
java.io.IOException
public int getSendBufferSize() throws java.io.IOException
java.io.IOException
public boolean isKeepAlive() throws java.io.IOException
java.io.IOException
public boolean isTcpNoDelay() throws java.io.IOException
java.io.IOException
public boolean isTcpCork() throws java.io.IOException
java.io.IOException
public int getSoLinger() throws java.io.IOException
java.io.IOException
public int getTcpDeferAccept() throws java.io.IOException
java.io.IOException
public boolean isTcpQuickAck() throws java.io.IOException
java.io.IOException
public int getSoError() throws java.io.IOException
java.io.IOException
public void setKeepAlive(boolean keepAlive) throws java.io.IOException
java.io.IOException
public void setReceiveBufferSize(int receiveBufferSize) throws java.io.IOException
java.io.IOException
public void setSendBufferSize(int sendBufferSize) throws java.io.IOException
java.io.IOException
public void setTcpNoDelay(boolean tcpNoDelay) throws java.io.IOException
java.io.IOException
public void setTcpCork(boolean tcpCork) throws java.io.IOException
java.io.IOException
public void setSoLinger(int soLinger) throws java.io.IOException
java.io.IOException
public void setTcpDeferAccept(int deferAccept) throws java.io.IOException
java.io.IOException
public void setTcpQuickAck(boolean quickAck) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class FileDescriptor
public static Socket newSocketStream()
public static Socket newSocketDgram()
public static Socket newSocketDomain()
private static int shutdown(int fd, boolean read, boolean write)
private static int connect(int fd, byte[] address, int scopeId, int port)
private static int connectDomainSocket(int fd, byte[] path)
private static int finishConnect(int fd)
private static int bind(int fd, byte[] address, int scopeId, int port)
private static int bindDomainSocket(int fd, byte[] path)
private static int listen(int fd, int backlog)
private static int accept(int fd, byte[] addr)
private static byte[] remoteAddress(int fd)
private static byte[] localAddress(int fd)
private static int sendTo(int fd, java.nio.ByteBuffer buf, int pos, int limit, byte[] address, int scopeId, int port)
private static int sendToAddress(int fd, long memoryAddress, int pos, int limit, byte[] address, int scopeId, int port)
private static int sendToAddresses(int fd, long memoryAddress, int length, byte[] address, int scopeId, int port)
private static DatagramSocketAddress recvFrom(int fd, java.nio.ByteBuffer buf, int pos, int limit) throws java.io.IOException
java.io.IOException
private static DatagramSocketAddress recvFromAddress(int fd, long memoryAddress, int pos, int limit) throws java.io.IOException
java.io.IOException
private static int newSocketStreamFd()
private static int newSocketDgramFd()
private static int newSocketDomainFd()
private static int getReceiveBufferSize(int fd) throws java.io.IOException
java.io.IOException
private static int getSendBufferSize(int fd) throws java.io.IOException
java.io.IOException
private static int isKeepAlive(int fd) throws java.io.IOException
java.io.IOException
private static int isTcpNoDelay(int fd) throws java.io.IOException
java.io.IOException
private static int isTcpCork(int fd) throws java.io.IOException
java.io.IOException
private static int getSoLinger(int fd) throws java.io.IOException
java.io.IOException
private static int getSoError(int fd) throws java.io.IOException
java.io.IOException
private static int getTcpDeferAccept(int fd) throws java.io.IOException
java.io.IOException
private static int isTcpQuickAck(int fd) throws java.io.IOException
java.io.IOException
private static void setKeepAlive(int fd, int keepAlive) throws java.io.IOException
java.io.IOException
private static void setReceiveBufferSize(int fd, int receiveBufferSize) throws java.io.IOException
java.io.IOException
private static void setSendBufferSize(int fd, int sendBufferSize) throws java.io.IOException
java.io.IOException
private static void setTcpNoDelay(int fd, int tcpNoDelay) throws java.io.IOException
java.io.IOException
private static void setTcpCork(int fd, int tcpCork) throws java.io.IOException
java.io.IOException
private static void setSoLinger(int fd, int soLinger) throws java.io.IOException
java.io.IOException
private static void setTcpDeferAccept(int fd, int deferAccept) throws java.io.IOException
java.io.IOException
private static void setTcpQuickAck(int fd, int quickAck) throws java.io.IOException
java.io.IOException