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