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, 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()
throws IOException
IOExceptionpublic int getSendBufferSize()
throws IOException
IOExceptionpublic boolean isKeepAlive()
throws IOException
IOExceptionpublic boolean isTcpNoDelay()
throws IOException
IOExceptionpublic boolean isTcpCork()
throws IOException
IOExceptionpublic int getSoLinger()
throws IOException
IOExceptionpublic int getTcpDeferAccept()
throws IOException
IOExceptionpublic boolean isTcpQuickAck()
throws IOException
IOExceptionpublic int getSoError()
throws IOException
IOExceptionpublic void setKeepAlive(boolean keepAlive)
throws IOException
IOExceptionpublic void setReceiveBufferSize(int receiveBufferSize)
throws IOException
IOExceptionpublic void setSendBufferSize(int sendBufferSize)
throws IOException
IOExceptionpublic void setTcpNoDelay(boolean tcpNoDelay)
throws IOException
IOExceptionpublic void setTcpCork(boolean tcpCork)
throws IOException
IOExceptionpublic void setSoLinger(int soLinger)
throws IOException
IOExceptionpublic void setTcpDeferAccept(int deferAccept)
throws IOException
IOExceptionpublic void setTcpQuickAck(boolean quickAck)
throws IOException
IOExceptionpublic 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.