Package io.netty.channel.unix
Class Socket
- java.lang.Object
- 
- io.netty.channel.unix.FileDescriptor
- 
- io.netty.channel.unix.Socket
 
 
- 
- Direct Known Subclasses:
- LinuxSocket
 
 public class Socket extends FileDescriptor Provides a JNI bridge to native socket operations. Internal usage only!
- 
- 
Field SummaryFields Modifier and Type Field Description protected booleanipv6static intUDS_SUN_PATH_SIZEDeprecated.
 - 
Constructor SummaryConstructors Constructor Description Socket(int fd)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intaccept(byte[] addr)voidbind(java.net.SocketAddress socketAddress)booleanconnect(java.net.SocketAddress socketAddress)voiddisconnect()booleanfinishConnect()intgetIntOpt(int level, int optname)voidgetRawOpt(int level, int optname, java.nio.ByteBuffer out)intgetReceiveBufferSize()intgetSendBufferSize()intgetSoError()intgetSoLinger()intgetTrafficClass()static voidinitialize()booleanisBroadcast()booleanisInputShutdown()static booleanisIPv6Preferred()booleanisKeepAlive()booleanisOutputShutdown()booleanisReuseAddress()booleanisReusePort()booleanisShutdown()booleanisTcpNoDelay()voidlisten(int backlog)java.net.InetSocketAddresslocalAddress()DomainSocketAddresslocalDomainSocketAddress()static SocketnewSocketDgram()protected static intnewSocketDgram0()protected static intnewSocketDgram0(boolean ipv6)protected static intnewSocketDgram0(InternetProtocolFamily family)Deprecated.protected static intnewSocketDgram0(SocketProtocolFamily family)static SocketnewSocketDomain()protected static intnewSocketDomain0()static SocketnewSocketDomainDgram()protected static intnewSocketDomainDgram0()static SocketnewSocketStream()protected static intnewSocketStream0()protected static intnewSocketStream0(boolean ipv6)protected static intnewSocketStream0(InternetProtocolFamily protocol)Deprecated.protected static intnewSocketStream0(SocketProtocolFamily protocol)intrecv(java.nio.ByteBuffer buf, int pos, int limit)intrecvAddress(long address, int pos, int limit)intrecvFd()DatagramSocketAddressrecvFrom(java.nio.ByteBuffer buf, int pos, int limit)DatagramSocketAddressrecvFromAddress(long memoryAddress, int pos, int limit)DomainDatagramSocketAddressrecvFromAddressDomainSocket(long memoryAddress, int pos, int limit)DomainDatagramSocketAddressrecvFromDomainSocket(java.nio.ByteBuffer buf, int pos, int limit)java.net.InetSocketAddressremoteAddress()DomainSocketAddressremoteDomainSocketAddress()intsend(java.nio.ByteBuffer buf, int pos, int limit)intsendAddress(long address, int pos, int limit)intsendFd(int fdToSend)intsendTo(java.nio.ByteBuffer buf, int pos, int limit, java.net.InetAddress addr, int port)intsendTo(java.nio.ByteBuffer buf, int pos, int limit, java.net.InetAddress addr, int port, boolean fastOpen)intsendToAddress(long memoryAddress, int pos, int limit, java.net.InetAddress addr, int port)intsendToAddress(long memoryAddress, int pos, int limit, java.net.InetAddress addr, int port, boolean fastOpen)intsendToAddressDomainSocket(long memoryAddress, int pos, int limit, byte[] path)intsendToAddresses(long memoryAddress, int length, java.net.InetAddress addr, int port)intsendToAddresses(long memoryAddress, int length, java.net.InetAddress addr, int port, boolean fastOpen)intsendToAddressesDomainSocket(long memoryAddress, int length, byte[] path)intsendToDomainSocket(java.nio.ByteBuffer buf, int pos, int limit, byte[] path)voidsetBroadcast(boolean broadcast)voidsetIntOpt(int level, int optname, int optvalue)voidsetKeepAlive(boolean keepAlive)voidsetRawOpt(int level, int optname, java.nio.ByteBuffer optvalue)voidsetReceiveBufferSize(int receiveBufferSize)voidsetReuseAddress(boolean reuseAddress)voidsetReusePort(boolean reusePort)voidsetSendBufferSize(int sendBufferSize)voidsetSoLinger(int soLinger)voidsetTcpNoDelay(boolean tcpNoDelay)voidsetTrafficClass(int trafficClass)static booleanshouldUseIpv6(InternetProtocolFamily family)Deprecated.static booleanshouldUseIpv6(SocketProtocolFamily family)voidshutdown()voidshutdown(boolean read, boolean write)java.lang.StringtoString()protected static booleanuseIpv6(Socket socket, java.net.InetAddress address)Returnstrueif the given socket and address combination should use IPv6 internally,falseotherwise.- 
Methods inherited from class io.netty.channel.unix.FileDescriptorclose, equals, from, from, hashCode, intValue, isOpen, markClosed, pipe, read, readAddress, write, writeAddress, writev, writevAddresses
 
- 
 
- 
- 
- 
Field Detail- 
UDS_SUN_PATH_SIZE@Deprecated public static final int UDS_SUN_PATH_SIZE Deprecated.- See Also:
- Constant Field Values
 
 - 
ipv6protected final boolean ipv6 
 
- 
 - 
Method Detail- 
useIpv6protected static boolean useIpv6(Socket socket, java.net.InetAddress address) Returnstrueif the given socket and address combination should use IPv6 internally,falseotherwise.
 - 
shutdownpublic final void shutdown() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
shutdownpublic final void shutdown(boolean read, boolean write) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
isShutdownpublic final boolean isShutdown() 
 - 
isInputShutdownpublic final boolean isInputShutdown() 
 - 
isOutputShutdownpublic final boolean isOutputShutdown() 
 - 
sendTopublic final int sendTo(java.nio.ByteBuffer buf, int pos, int limit, java.net.InetAddress addr, int port) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
sendTopublic final int sendTo(java.nio.ByteBuffer buf, int pos, int limit, java.net.InetAddress addr, int port, boolean fastOpen) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
sendToDomainSocketpublic final int sendToDomainSocket(java.nio.ByteBuffer buf, int pos, int limit, byte[] path) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
sendToAddresspublic final int sendToAddress(long memoryAddress, int pos, int limit, java.net.InetAddress addr, int port) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
sendToAddresspublic final int sendToAddress(long memoryAddress, int pos, int limit, java.net.InetAddress addr, int port, boolean fastOpen) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
sendToAddressDomainSocketpublic final int sendToAddressDomainSocket(long memoryAddress, int pos, int limit, byte[] path) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
sendToAddressespublic final int sendToAddresses(long memoryAddress, int length, java.net.InetAddress addr, int port) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
sendToAddressespublic final int sendToAddresses(long memoryAddress, int length, java.net.InetAddress addr, int port, boolean fastOpen) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
sendToAddressesDomainSocketpublic final int sendToAddressesDomainSocket(long memoryAddress, int length, byte[] path) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
recvFrompublic final DatagramSocketAddress recvFrom(java.nio.ByteBuffer buf, int pos, int limit) throws java.io.IOException - Throws:
- java.io.IOException
 
 - 
recvFromAddresspublic final DatagramSocketAddress recvFromAddress(long memoryAddress, int pos, int limit) throws java.io.IOException - Throws:
- java.io.IOException
 
 - 
recvFromDomainSocketpublic final DomainDatagramSocketAddress recvFromDomainSocket(java.nio.ByteBuffer buf, int pos, int limit) throws java.io.IOException - Throws:
- java.io.IOException
 
 - 
recvFromAddressDomainSocketpublic final DomainDatagramSocketAddress recvFromAddressDomainSocket(long memoryAddress, int pos, int limit) throws java.io.IOException - Throws:
- java.io.IOException
 
 - 
recvpublic int recv(java.nio.ByteBuffer buf, int pos, int limit) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
recvAddresspublic int recvAddress(long address, int pos, int limit) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
sendpublic int send(java.nio.ByteBuffer buf, int pos, int limit) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
sendAddresspublic int sendAddress(long address, int pos, int limit) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
recvFdpublic final int recvFd() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
sendFdpublic final int sendFd(int fdToSend) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
connectpublic final boolean connect(java.net.SocketAddress socketAddress) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
finishConnectpublic final boolean finishConnect() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
disconnectpublic final void disconnect() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
bindpublic final void bind(java.net.SocketAddress socketAddress) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
listenpublic final void listen(int backlog) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
acceptpublic final int accept(byte[] addr) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
remoteAddresspublic final java.net.InetSocketAddress remoteAddress() 
 - 
remoteDomainSocketAddresspublic final DomainSocketAddress remoteDomainSocketAddress() 
 - 
localAddresspublic final java.net.InetSocketAddress localAddress() 
 - 
localDomainSocketAddresspublic final DomainSocketAddress localDomainSocketAddress() 
 - 
getReceiveBufferSizepublic final int getReceiveBufferSize() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
getSendBufferSizepublic final int getSendBufferSize() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
isKeepAlivepublic final boolean isKeepAlive() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
isTcpNoDelaypublic final boolean isTcpNoDelay() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
isReuseAddresspublic final boolean isReuseAddress() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
isReusePortpublic final boolean isReusePort() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
isBroadcastpublic final boolean isBroadcast() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
getSoLingerpublic final int getSoLinger() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
getSoErrorpublic final int getSoError() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
getTrafficClasspublic final int getTrafficClass() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
setKeepAlivepublic final void setKeepAlive(boolean keepAlive) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
setReceiveBufferSizepublic final void setReceiveBufferSize(int receiveBufferSize) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
setSendBufferSizepublic final void setSendBufferSize(int sendBufferSize) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
setTcpNoDelaypublic final void setTcpNoDelay(boolean tcpNoDelay) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
setSoLingerpublic final void setSoLinger(int soLinger) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
setReuseAddresspublic final void setReuseAddress(boolean reuseAddress) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
setReusePortpublic final void setReusePort(boolean reusePort) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
setBroadcastpublic final void setBroadcast(boolean broadcast) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
setTrafficClasspublic final void setTrafficClass(int trafficClass) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
setIntOptpublic void setIntOpt(int level, int optname, int optvalue) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
setRawOptpublic void setRawOpt(int level, int optname, java.nio.ByteBuffer optvalue) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
getIntOptpublic int getIntOpt(int level, int optname) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
getRawOptpublic void getRawOpt(int level, int optname, java.nio.ByteBuffer out) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
isIPv6Preferredpublic static boolean isIPv6Preferred() 
 - 
shouldUseIpv6@Deprecated public static boolean shouldUseIpv6(InternetProtocolFamily family) Deprecated.
 - 
shouldUseIpv6public static boolean shouldUseIpv6(SocketProtocolFamily family) 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- FileDescriptor
 
 - 
newSocketStreampublic static Socket newSocketStream() 
 - 
newSocketDgrampublic static Socket newSocketDgram() 
 - 
newSocketDomainpublic static Socket newSocketDomain() 
 - 
newSocketDomainDgrampublic static Socket newSocketDomainDgram() 
 - 
initializepublic static void initialize() 
 - 
newSocketStream0protected static int newSocketStream0() 
 - 
newSocketStream0@Deprecated protected static int newSocketStream0(InternetProtocolFamily protocol) Deprecated.- Parameters:
- protocol-
- Returns:
 
 - 
newSocketStream0protected static int newSocketStream0(SocketProtocolFamily protocol) 
 - 
newSocketStream0protected static int newSocketStream0(boolean ipv6) 
 - 
newSocketDgram0protected static int newSocketDgram0() 
 - 
newSocketDgram0@Deprecated protected static int newSocketDgram0(InternetProtocolFamily family) Deprecated.
 - 
newSocketDgram0protected static int newSocketDgram0(SocketProtocolFamily family) 
 - 
newSocketDgram0protected static int newSocketDgram0(boolean ipv6) 
 - 
newSocketDomain0protected static int newSocketDomain0() 
 - 
newSocketDomainDgram0protected static int newSocketDomainDgram0() 
 
- 
 
-