public final class Socket extends FileDescriptor
构造器和说明 |
---|
Socket(int fd) |
限定符和类型 | 方法和说明 |
---|---|
int |
accept(byte[] addr) |
void |
bind(java.net.SocketAddress socketAddress) |
boolean |
connect(java.net.SocketAddress socketAddress) |
void |
disconnect() |
boolean |
finishConnect() |
PeerCredentials |
getPeerCredentials() |
int |
getReceiveBufferSize() |
int |
getSendBufferSize() |
int |
getSoError() |
int |
getSoLinger() |
int |
getTcpDeferAccept() |
static void |
initialize() |
boolean |
isInputShutdown() |
boolean |
isKeepAlive() |
boolean |
isOutputShutdown() |
boolean |
isShutdown() |
boolean |
isTcpCork() |
boolean |
isTcpNoDelay() |
boolean |
isTcpQuickAck() |
void |
listen(int backlog) |
java.net.InetSocketAddress |
localAddress() |
static Socket |
newSocketDgram() |
static Socket |
newSocketDomain() |
static Socket |
newSocketStream() |
DatagramSocketAddress |
recvFrom(java.nio.ByteBuffer buf,
int pos,
int limit) |
DatagramSocketAddress |
recvFromAddress(long memoryAddress,
int pos,
int limit) |
java.net.InetSocketAddress |
remoteAddress() |
int |
sendTo(java.nio.ByteBuffer buf,
int pos,
int limit,
java.net.InetAddress addr,
int port) |
int |
sendToAddress(long memoryAddress,
int pos,
int limit,
java.net.InetAddress addr,
int port) |
int |
sendToAddresses(long memoryAddress,
int length,
java.net.InetAddress addr,
int port) |
void |
setKeepAlive(boolean keepAlive) |
void |
setReceiveBufferSize(int receiveBufferSize) |
void |
setSendBufferSize(int sendBufferSize) |
void |
setSoLinger(int soLinger) |
void |
setTcpCork(boolean tcpCork) |
void |
setTcpDeferAccept(int deferAccept) |
void |
setTcpNoDelay(boolean tcpNoDelay) |
void |
setTcpQuickAck(boolean quickAck) |
void |
shutdown() |
void |
shutdown(boolean read,
boolean write) |
java.lang.String |
toString() |
close, equals, from, from, hashCode, intValue, isOpen, pipe, read, readAddress, write, writeAddress, writev, writevAddresses
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 disconnect() 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 PeerCredentials getPeerCredentials() 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
在类中 FileDescriptor
public static void initialize()
public static Socket newSocketStream()
public static Socket newSocketDgram()
public static Socket newSocketDomain()