public class Socket extends FileDescriptor
| Modifier and Type | Field and Description |
|---|---|
static int |
UDS_SUN_PATH_SIZE |
| 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 |
getTrafficClass() |
boolean |
isBroadcast() |
boolean |
isInputShutdown() |
boolean |
isKeepAlive() |
boolean |
isOutputShutdown() |
boolean |
isReuseAddress() |
boolean |
isReusePort() |
boolean |
isShutdown() |
boolean |
isTcpNoDelay() |
void |
listen(int backlog) |
InetSocketAddress |
localAddress() |
static Socket |
newSocketDgram() |
protected static int |
newSocketDgram0() |
static Socket |
newSocketDomain() |
protected static int |
newSocketDomain0() |
static Socket |
newSocketStream() |
protected static int |
newSocketStream0() |
int |
recvFd() |
DatagramSocketAddress |
recvFrom(ByteBuffer buf,
int pos,
int limit) |
DatagramSocketAddress |
recvFromAddress(long memoryAddress,
int pos,
int limit) |
InetSocketAddress |
remoteAddress() |
int |
sendFd(int fdToSend) |
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 |
setBroadcast(boolean broadcast) |
void |
setKeepAlive(boolean keepAlive) |
void |
setReceiveBufferSize(int receiveBufferSize) |
void |
setReuseAddress(boolean reuseAddress) |
void |
setReusePort(boolean reusePort) |
void |
setSendBufferSize(int sendBufferSize) |
void |
setSoLinger(int soLinger) |
void |
setTcpNoDelay(boolean tcpNoDelay) |
void |
setTrafficClass(int trafficClass) |
void |
shutdown() |
void |
shutdown(boolean read,
boolean write) |
String |
toString() |
close, equals, from, from, hashCode, intValue, isOpen, pipe, read, readAddress, write, writeAddress, writev, writevAddressespublic final void shutdown()
throws IOException
IOExceptionpublic final void shutdown(boolean read,
boolean write)
throws IOException
IOExceptionpublic final boolean isShutdown()
public final boolean isInputShutdown()
public final boolean isOutputShutdown()
public final int sendTo(ByteBuffer buf, int pos, int limit, InetAddress addr, int port) throws IOException
IOExceptionpublic final int sendToAddress(long memoryAddress,
int pos,
int limit,
InetAddress addr,
int port)
throws IOException
IOExceptionpublic final int sendToAddresses(long memoryAddress,
int length,
InetAddress addr,
int port)
throws IOException
IOExceptionpublic final DatagramSocketAddress recvFrom(ByteBuffer buf, int pos, int limit) throws IOException
IOExceptionpublic final DatagramSocketAddress recvFromAddress(long memoryAddress, int pos, int limit) throws IOException
IOExceptionpublic final int recvFd()
throws IOException
IOExceptionpublic final int sendFd(int fdToSend)
throws IOException
IOExceptionpublic final boolean connect(SocketAddress socketAddress) throws IOException
IOExceptionpublic final boolean finishConnect()
throws IOException
IOExceptionpublic final void bind(SocketAddress socketAddress) throws IOException
IOExceptionpublic final void listen(int backlog)
throws IOException
IOExceptionpublic final int accept(byte[] addr)
throws IOException
IOExceptionpublic final InetSocketAddress remoteAddress()
public final InetSocketAddress localAddress()
public final int getReceiveBufferSize()
throws IOException
IOExceptionpublic final int getSendBufferSize()
throws IOException
IOExceptionpublic final boolean isKeepAlive()
throws IOException
IOExceptionpublic final boolean isTcpNoDelay()
throws IOException
IOExceptionpublic final boolean isReuseAddress()
throws IOException
IOExceptionpublic final boolean isReusePort()
throws IOException
IOExceptionpublic final boolean isBroadcast()
throws IOException
IOExceptionpublic final int getSoLinger()
throws IOException
IOExceptionpublic final int getSoError()
throws IOException
IOExceptionpublic final int getTrafficClass()
throws IOException
IOExceptionpublic final void setKeepAlive(boolean keepAlive)
throws IOException
IOExceptionpublic final void setReceiveBufferSize(int receiveBufferSize)
throws IOException
IOExceptionpublic final void setSendBufferSize(int sendBufferSize)
throws IOException
IOExceptionpublic final void setTcpNoDelay(boolean tcpNoDelay)
throws IOException
IOExceptionpublic final void setSoLinger(int soLinger)
throws IOException
IOExceptionpublic final void setReuseAddress(boolean reuseAddress)
throws IOException
IOExceptionpublic final void setReusePort(boolean reusePort)
throws IOException
IOExceptionpublic final void setBroadcast(boolean broadcast)
throws IOException
IOExceptionpublic final void setTrafficClass(int trafficClass)
throws IOException
IOExceptionpublic String toString()
toString in class FileDescriptorpublic static Socket newSocketStream()
public static Socket newSocketDgram()
public static Socket newSocketDomain()
protected static int newSocketStream0()
protected static int newSocketDgram0()
protected static int newSocketDomain0()
Copyright © 2008–2017 The Netty Project. All rights reserved.