public class Socket extends FileDescriptor
Modifier and Type | Field and Description |
---|---|
protected boolean |
ipv6 |
static int |
UDS_SUN_PATH_SIZE
Deprecated.
|
Constructor and Description |
---|
Socket(int fd) |
Modifier and Type | Method and Description |
---|---|
int |
accept(byte[] addr) |
void |
bind(SocketAddress socketAddress) |
boolean |
connect(SocketAddress socketAddress) |
void |
disconnect() |
boolean |
finishConnect() |
int |
getIntOpt(int level,
int optname) |
void |
getRawOpt(int level,
int optname,
ByteBuffer out) |
int |
getReceiveBufferSize() |
int |
getSendBufferSize() |
int |
getSoError() |
int |
getSoLinger() |
int |
getTrafficClass() |
static void |
initialize() |
boolean |
isBroadcast() |
boolean |
isInputShutdown() |
static boolean |
isIPv6Preferred() |
boolean |
isKeepAlive() |
boolean |
isOutputShutdown() |
boolean |
isReuseAddress() |
boolean |
isReusePort() |
boolean |
isShutdown() |
boolean |
isTcpNoDelay() |
void |
listen(int backlog) |
InetSocketAddress |
localAddress() |
DomainSocketAddress |
localDomainSocketAddress() |
static Socket |
newSocketDgram() |
protected static int |
newSocketDgram0() |
protected static int |
newSocketDgram0(boolean ipv6) |
protected static int |
newSocketDgram0(InternetProtocolFamily family) |
static Socket |
newSocketDomain() |
protected static int |
newSocketDomain0() |
static Socket |
newSocketDomainDgram() |
protected static int |
newSocketDomainDgram0() |
static Socket |
newSocketStream() |
protected static int |
newSocketStream0() |
protected static int |
newSocketStream0(boolean ipv6) |
protected static int |
newSocketStream0(InternetProtocolFamily protocol) |
int |
recv(ByteBuffer buf,
int pos,
int limit) |
int |
recvAddress(long address,
int pos,
int limit) |
int |
recvFd() |
DatagramSocketAddress |
recvFrom(ByteBuffer buf,
int pos,
int limit) |
DatagramSocketAddress |
recvFromAddress(long memoryAddress,
int pos,
int limit) |
DomainDatagramSocketAddress |
recvFromAddressDomainSocket(long memoryAddress,
int pos,
int limit) |
DomainDatagramSocketAddress |
recvFromDomainSocket(ByteBuffer buf,
int pos,
int limit) |
InetSocketAddress |
remoteAddress() |
DomainSocketAddress |
remoteDomainSocketAddress() |
int |
send(ByteBuffer buf,
int pos,
int limit) |
int |
sendAddress(long address,
int pos,
int limit) |
int |
sendFd(int fdToSend) |
int |
sendTo(ByteBuffer buf,
int pos,
int limit,
InetAddress addr,
int port) |
int |
sendTo(ByteBuffer buf,
int pos,
int limit,
InetAddress addr,
int port,
boolean fastOpen) |
int |
sendToAddress(long memoryAddress,
int pos,
int limit,
InetAddress addr,
int port) |
int |
sendToAddress(long memoryAddress,
int pos,
int limit,
InetAddress addr,
int port,
boolean fastOpen) |
int |
sendToAddressDomainSocket(long memoryAddress,
int pos,
int limit,
byte[] path) |
int |
sendToAddresses(long memoryAddress,
int length,
InetAddress addr,
int port) |
int |
sendToAddresses(long memoryAddress,
int length,
InetAddress addr,
int port,
boolean fastOpen) |
int |
sendToAddressesDomainSocket(long memoryAddress,
int length,
byte[] path) |
int |
sendToDomainSocket(ByteBuffer buf,
int pos,
int limit,
byte[] path) |
void |
setBroadcast(boolean broadcast) |
void |
setIntOpt(int level,
int optname,
int optvalue) |
void |
setKeepAlive(boolean keepAlive) |
void |
setRawOpt(int level,
int optname,
ByteBuffer optvalue) |
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) |
static boolean |
shouldUseIpv6(InternetProtocolFamily family) |
void |
shutdown() |
void |
shutdown(boolean read,
boolean write) |
String |
toString() |
protected static boolean |
useIpv6(Socket socket,
InetAddress address)
Returns
true if the given socket and address combination should use IPv6 internally,
false otherwise. |
close, equals, from, from, hashCode, intValue, isOpen, markClosed, pipe, read, readAddress, write, writeAddress, writev, writevAddresses
@Deprecated public static final int UDS_SUN_PATH_SIZE
protected final boolean ipv6
protected static boolean useIpv6(Socket socket, InetAddress address)
true
if the given socket and address combination should use IPv6 internally,
false
otherwise.public final void shutdown() throws IOException
IOException
public final void shutdown(boolean read, boolean write) throws IOException
IOException
public 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
IOException
public final int sendTo(ByteBuffer buf, int pos, int limit, InetAddress addr, int port, boolean fastOpen) throws IOException
IOException
public final int sendToDomainSocket(ByteBuffer buf, int pos, int limit, byte[] path) throws IOException
IOException
public final int sendToAddress(long memoryAddress, int pos, int limit, InetAddress addr, int port) throws IOException
IOException
public final int sendToAddress(long memoryAddress, int pos, int limit, InetAddress addr, int port, boolean fastOpen) throws IOException
IOException
public final int sendToAddressDomainSocket(long memoryAddress, int pos, int limit, byte[] path) throws IOException
IOException
public final int sendToAddresses(long memoryAddress, int length, InetAddress addr, int port) throws IOException
IOException
public final int sendToAddresses(long memoryAddress, int length, InetAddress addr, int port, boolean fastOpen) throws IOException
IOException
public final int sendToAddressesDomainSocket(long memoryAddress, int length, byte[] path) throws IOException
IOException
public final DatagramSocketAddress recvFrom(ByteBuffer buf, int pos, int limit) throws IOException
IOException
public final DatagramSocketAddress recvFromAddress(long memoryAddress, int pos, int limit) throws IOException
IOException
public final DomainDatagramSocketAddress recvFromDomainSocket(ByteBuffer buf, int pos, int limit) throws IOException
IOException
public final DomainDatagramSocketAddress recvFromAddressDomainSocket(long memoryAddress, int pos, int limit) throws IOException
IOException
public int recv(ByteBuffer buf, int pos, int limit) throws IOException
IOException
public int recvAddress(long address, int pos, int limit) throws IOException
IOException
public int send(ByteBuffer buf, int pos, int limit) throws IOException
IOException
public int sendAddress(long address, int pos, int limit) throws IOException
IOException
public final int recvFd() throws IOException
IOException
public final int sendFd(int fdToSend) throws IOException
IOException
public final boolean connect(SocketAddress socketAddress) throws IOException
IOException
public final boolean finishConnect() throws IOException
IOException
public final void disconnect() throws IOException
IOException
public final void bind(SocketAddress socketAddress) throws IOException
IOException
public final void listen(int backlog) throws IOException
IOException
public final int accept(byte[] addr) throws IOException
IOException
public final InetSocketAddress remoteAddress()
public final DomainSocketAddress remoteDomainSocketAddress()
public final InetSocketAddress localAddress()
public final DomainSocketAddress localDomainSocketAddress()
public final int getReceiveBufferSize() throws IOException
IOException
public final int getSendBufferSize() throws IOException
IOException
public final boolean isKeepAlive() throws IOException
IOException
public final boolean isTcpNoDelay() throws IOException
IOException
public final boolean isReuseAddress() throws IOException
IOException
public final boolean isReusePort() throws IOException
IOException
public final boolean isBroadcast() throws IOException
IOException
public final int getSoLinger() throws IOException
IOException
public final int getSoError() throws IOException
IOException
public final int getTrafficClass() throws IOException
IOException
public final void setKeepAlive(boolean keepAlive) throws IOException
IOException
public final void setReceiveBufferSize(int receiveBufferSize) throws IOException
IOException
public final void setSendBufferSize(int sendBufferSize) throws IOException
IOException
public final void setTcpNoDelay(boolean tcpNoDelay) throws IOException
IOException
public final void setSoLinger(int soLinger) throws IOException
IOException
public final void setReuseAddress(boolean reuseAddress) throws IOException
IOException
public final void setReusePort(boolean reusePort) throws IOException
IOException
public final void setBroadcast(boolean broadcast) throws IOException
IOException
public final void setTrafficClass(int trafficClass) throws IOException
IOException
public void setIntOpt(int level, int optname, int optvalue) throws IOException
IOException
public void setRawOpt(int level, int optname, ByteBuffer optvalue) throws IOException
IOException
public int getIntOpt(int level, int optname) throws IOException
IOException
public void getRawOpt(int level, int optname, ByteBuffer out) throws IOException
IOException
public static boolean isIPv6Preferred()
public static boolean shouldUseIpv6(InternetProtocolFamily family)
public String toString()
toString
in class FileDescriptor
public static Socket newSocketStream()
public static Socket newSocketDgram()
public static Socket newSocketDomain()
public static Socket newSocketDomainDgram()
public static void initialize()
protected static int newSocketStream0()
protected static int newSocketStream0(InternetProtocolFamily protocol)
protected static int newSocketStream0(boolean ipv6)
protected static int newSocketDgram0()
protected static int newSocketDgram0(InternetProtocolFamily family)
protected static int newSocketDgram0(boolean ipv6)
protected static int newSocketDomain0()
protected static int newSocketDomainDgram0()
Copyright © 2008–2024 The Netty Project. All rights reserved.