public final class Socket extends FileDescriptor
Constructor and Description |
---|
Socket(int fd) |
Modifier and Type | Method and Description |
---|---|
int |
accept(byte[] addr) |
void |
bind(SocketAddress socketAddress) |
boolean |
connect(SocketAddress socketAddress) |
boolean |
finishConnect() |
int |
getReceiveBufferSize() |
int |
getSendBufferSize() |
int |
getSoError() |
int |
getSoLinger() |
int |
getTcpDeferAccept() |
boolean |
isInputShutdown() |
boolean |
isKeepAlive() |
boolean |
isOutputShutdown() |
boolean |
isShutdown() |
boolean |
isTcpCork() |
boolean |
isTcpNoDelay() |
boolean |
isTcpQuickAck() |
void |
listen(int backlog) |
InetSocketAddress |
localAddress() |
static Socket |
newSocketDgram() |
static Socket |
newSocketDomain() |
static Socket |
newSocketStream() |
DatagramSocketAddress |
recvFrom(ByteBuffer buf,
int pos,
int limit) |
DatagramSocketAddress |
recvFromAddress(long memoryAddress,
int pos,
int limit) |
InetSocketAddress |
remoteAddress() |
int |
sendTo(ByteBuffer buf,
int pos,
int limit,
InetAddress addr,
int port) |
int |
sendToAddress(long memoryAddress,
int pos,
int limit,
InetAddress addr,
int port) |
int |
sendToAddresses(long memoryAddress,
int length,
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) |
String |
toString() |
close, equals, from, from, hashCode, intValue, isOpen, pipe, read, readAddress, write, writeAddress, writev, writevAddresses
public void shutdown() throws IOException
IOException
public void shutdown(boolean read, boolean write) throws IOException
IOException
public boolean isShutdown()
public boolean isInputShutdown()
public boolean isOutputShutdown()
public int sendTo(ByteBuffer buf, int pos, int limit, InetAddress addr, int port) throws IOException
IOException
public int sendToAddress(long memoryAddress, int pos, int limit, InetAddress addr, int port) throws IOException
IOException
public int sendToAddresses(long memoryAddress, int length, InetAddress addr, int port) throws IOException
IOException
public DatagramSocketAddress recvFrom(ByteBuffer buf, int pos, int limit) throws IOException
IOException
public DatagramSocketAddress recvFromAddress(long memoryAddress, int pos, int limit) throws IOException
IOException
public boolean connect(SocketAddress socketAddress) throws IOException
IOException
public boolean finishConnect() throws IOException
IOException
public void bind(SocketAddress socketAddress) throws IOException
IOException
public void listen(int backlog) throws IOException
IOException
public int accept(byte[] addr) throws IOException
IOException
public InetSocketAddress remoteAddress()
public InetSocketAddress localAddress()
public int getReceiveBufferSize() throws IOException
IOException
public int getSendBufferSize() throws IOException
IOException
public boolean isKeepAlive() throws IOException
IOException
public boolean isTcpNoDelay() throws IOException
IOException
public boolean isTcpCork() throws IOException
IOException
public int getSoLinger() throws IOException
IOException
public int getTcpDeferAccept() throws IOException
IOException
public boolean isTcpQuickAck() throws IOException
IOException
public int getSoError() throws IOException
IOException
public void setKeepAlive(boolean keepAlive) throws IOException
IOException
public void setReceiveBufferSize(int receiveBufferSize) throws IOException
IOException
public void setSendBufferSize(int sendBufferSize) throws IOException
IOException
public void setTcpNoDelay(boolean tcpNoDelay) throws IOException
IOException
public void setTcpCork(boolean tcpCork) throws IOException
IOException
public void setSoLinger(int soLinger) throws IOException
IOException
public void setTcpDeferAccept(int deferAccept) throws IOException
IOException
public void setTcpQuickAck(boolean quickAck) throws IOException
IOException
public String toString()
toString
in class FileDescriptor
public static Socket newSocketStream()
public static Socket newSocketDgram()
public static Socket newSocketDomain()
Copyright © 2008–2016 The Netty Project. All rights reserved.