Class LinuxSocket
java.lang.Object
io.netty.channel.unix.FileDescriptor
io.netty.channel.unix.Socket
io.netty.channel.epoll.LinuxSocket
A socket which provides access Linux native methods.
-
Field Summary
FieldsFields inherited from class Socket
ipv6, UDS_SUN_PATH_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intbindVSock(int fd, int cid, int port) voidbindVSock(VSockAddress address) private static intconnectVSock(int fd, int cid, int port) booleanconnectVSock(VSockAddress address) private static InetAddressderiveInetAddress(NetworkInterface netInterface, boolean ipv6) (package private) InternetProtocolFamilyfamily()private static intgetIntAt(byte[] array, int startIndex) (package private) InetAddressprivate static intgetInterface(int fd, boolean ipv6) private static intgetIpMulticastLoop(int fd, boolean ipv6) (package private) NetworkInterface(package private) PeerCredentialsprivate static PeerCredentialsgetPeerCredentials(int fd) (package private) intprivate static intgetSoBusyPoll(int fd) (package private) intprivate static intgetTcpDeferAccept(int fd) private static voidgetTcpInfo(int fd, long[] array) (package private) voidgetTcpInfo(EpollTcpInfo info) (package private) intprivate static intgetTcpKeepCnt(int fd) (package private) intprivate static intgetTcpKeepIdle(int fd) (package private) intprivate static intgetTcpKeepIntvl(int fd) (package private) longprivate static intgetTcpNotSentLowAt(int fd) (package private) intprivate static intgetTcpUserTimeout(int fd) (package private) intprivate static intgetTimeToLive(int fd) private static InetAddressinetAddress(int value) private static intinterfaceIndex(InetAddress address) private static intinterfaceIndex(NetworkInterface networkInterface) (package private) booleanprivate static intisIpBindAddressNoPort(int fd) (package private) booleanprivate static intisIpFreeBind(int fd) (package private) booleanprivate static intisIpRecvOrigDestAddr(int fd) (package private) booleanprivate static intisIpTransparent(int fd) (package private) boolean(package private) booleanprivate static intisTcpCork(int fd) (package private) booleanprivate static intisTcpQuickAck(int fd) (package private) booleanisUdpGro()private static intisUdpGro(int fd) private static voidjoinGroup(int fd, boolean ipv6, byte[] group, byte[] interfaceAddress, int scopeId, int interfaceIndex) (package private) voidjoinGroup(InetAddress group, NetworkInterface netInterface, InetAddress source) private static voidjoinSsmGroup(int fd, boolean ipv6, byte[] group, byte[] interfaceAddress, int scopeId, int interfaceIndex, byte[] source) private static voidleaveGroup(int fd, boolean ipv6, byte[] group, byte[] interfaceAddress, int scopeId, int interfaceIndex) (package private) voidleaveGroup(InetAddress group, NetworkInterface netInterface, InetAddress source) private static voidleaveSsmGroup(int fd, boolean ipv6, byte[] group, byte[] interfaceAddress, int scopeId, int interfaceIndex, byte[] source) private static byte[]localVSockAddress(int fd) static LinuxSocketnewSocket(int fd) static LinuxSocketstatic LinuxSocketnewSocketDgram(boolean ipv6) static LinuxSocketnewSocketDgram(InternetProtocolFamily family) static LinuxSocketstatic LinuxSocketstatic LinuxSocketstatic LinuxSocketnewSocketStream(boolean ipv6) static LinuxSocketnewSocketStream(InternetProtocolFamily protocol) static LinuxSocket(package private) static intprivate static int(package private) intrecvmmsg(NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len) (package private) intprivate static byte[]remoteVSockAddress(int fd) private static longsendFile(int socketFd, DefaultFileRegion src, long baseOffset, long offset, long length) (package private) longsendFile(DefaultFileRegion src, long baseOffset, long offset, long length) (package private) intsendmmsg(NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len) private static voidsetInterface(int fd, boolean ipv6, byte[] interfaceAddress, int scopeId, int networkInterfaceIndex) (package private) voidsetInterface(InetAddress address) (package private) voidsetIpBindAddressNoPort(boolean enabled) private static voidsetIpBindAddressNoPort(int fd, int ipBindAddressNoPort) (package private) voidsetIpFreeBind(boolean enabled) private static voidsetIpFreeBind(int fd, int freeBind) private static voidsetIpMulticastLoop(int fd, boolean ipv6, int enabled) (package private) voidsetIpRecvOrigDestAddr(boolean enabled) private static voidsetIpRecvOrigDestAddr(int fd, int transparent) (package private) voidsetIpTransparent(boolean enabled) private static voidsetIpTransparent(int fd, int transparent) (package private) voidsetLoopbackModeDisabled(boolean loopbackModeDisabled) (package private) voidsetNetworkInterface(NetworkInterface netInterface) (package private) voidsetSoBusyPoll(int loopMicros) private static voidsetSoBusyPoll(int fd, int loopMicros) (package private) voidsetTcpCork(boolean tcpCork) private static voidsetTcpCork(int fd, int tcpCork) (package private) voidsetTcpDeferAccept(int deferAccept) private static voidsetTcpDeferAccept(int fd, int deferAccept) (package private) voidsetTcpFastOpen(int tcpFastopenBacklog) private static voidsetTcpFastOpen(int fd, int tcpFastopenBacklog) (package private) voidsetTcpKeepCnt(int probes) private static voidsetTcpKeepCnt(int fd, int probes) (package private) voidsetTcpKeepIdle(int seconds) private static voidsetTcpKeepIdle(int fd, int seconds) (package private) voidsetTcpKeepIntvl(int seconds) private static voidsetTcpKeepIntvl(int fd, int seconds) private static voidsetTcpMd5Sig(int fd, boolean ipv6, byte[] address, int scopeId, byte[] key) (package private) voidsetTcpMd5Sig(InetAddress address, byte[] key) private static voidsetTcpNotSentLowAt(int fd, int tcpNotSentLowAt) (package private) voidsetTcpNotSentLowAt(long tcpNotSentLowAt) (package private) voidsetTcpQuickAck(boolean quickAck) private static voidsetTcpQuickAck(int fd, int quickAck) (package private) voidsetTcpUserTimeout(int milliseconds) private static voidsetTcpUserTimeout(int fd, int milliseconds) (package private) voidsetTimeToLive(int ttl) private static voidsetTimeToLive(int fd, int ttl) (package private) voidsetUdpGro(boolean gro) private static voidsetUdpGro(int fd, int gro) Methods inherited from class Socket
accept, bind, connect, disconnect, finishConnect, getIntOpt, getRawOpt, getReceiveBufferSize, getSendBufferSize, getSoError, getSoLinger, getTrafficClass, initialize, isBroadcast, isInputShutdown, isIPv6Preferred, isKeepAlive, isOutputShutdown, isReuseAddress, isReusePort, isShutdown, isTcpNoDelay, listen, localAddress, localDomainSocketAddress, newSocketDgram0, newSocketDgram0, newSocketDgram0, newSocketDomain0, newSocketDomainDgram0, newSocketStream0, newSocketStream0, newSocketStream0, recv, recvAddress, recvFd, recvFrom, recvFromAddress, recvFromAddressDomainSocket, recvFromDomainSocket, remoteAddress, remoteDomainSocketAddress, send, sendAddress, sendFd, sendTo, sendTo, sendToAddress, sendToAddress, sendToAddressDomainSocket, sendToAddresses, sendToAddresses, sendToAddressesDomainSocket, sendToDomainSocket, setBroadcast, setIntOpt, setKeepAlive, setRawOpt, setReceiveBufferSize, setReuseAddress, setReusePort, setSendBufferSize, setSoLinger, setTcpNoDelay, setTrafficClass, shouldUseIpv6, shutdown, shutdown, toString, useIpv6Methods inherited from class FileDescriptor
close, equals, from, from, hashCode, intValue, isOpen, markClosed, pipe, read, readAddress, write, writeAddress, writev, writevAddresses
-
Field Details
-
MAX_UINT32_T
private static final long MAX_UINT32_T- See Also:
-
-
Constructor Details
-
LinuxSocket
LinuxSocket(int fd)
-
-
Method Details
-
family
InternetProtocolFamily family() -
sendmmsg
int sendmmsg(NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len) throws IOException - Throws:
IOException
-
recvmmsg
int recvmmsg(NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len) throws IOException - Throws:
IOException
-
recvmsg
- Throws:
IOException
-
setTimeToLive
- Throws:
IOException
-
setInterface
- Throws:
IOException
-
setNetworkInterface
- Throws:
IOException
-
getInterface
- Throws:
IOException
-
getNetworkInterface
- Throws:
IOException
-
inetAddress
-
joinGroup
void joinGroup(InetAddress group, NetworkInterface netInterface, InetAddress source) throws IOException - Throws:
IOException
-
leaveGroup
void leaveGroup(InetAddress group, NetworkInterface netInterface, InetAddress source) throws IOException - Throws:
IOException
-
interfaceIndex
-
interfaceIndex
- Throws:
IOException
-
setTcpDeferAccept
- Throws:
IOException
-
setTcpQuickAck
- Throws:
IOException
-
setTcpCork
- Throws:
IOException
-
setSoBusyPoll
- Throws:
IOException
-
setTcpNotSentLowAt
- Throws:
IOException
-
setTcpFastOpen
- Throws:
IOException
-
setTcpKeepIdle
- Throws:
IOException
-
setTcpKeepIntvl
- Throws:
IOException
-
setTcpKeepCnt
- Throws:
IOException
-
setTcpUserTimeout
- Throws:
IOException
-
setIpBindAddressNoPort
- Throws:
IOException
-
setIpFreeBind
- Throws:
IOException
-
setIpTransparent
- Throws:
IOException
-
setIpRecvOrigDestAddr
- Throws:
IOException
-
getTimeToLive
- Throws:
IOException
-
getTcpInfo
- Throws:
IOException
-
setTcpMd5Sig
- Throws:
IOException
-
isTcpCork
- Throws:
IOException
-
getSoBusyPoll
- Throws:
IOException
-
getTcpDeferAccept
- Throws:
IOException
-
isTcpQuickAck
- Throws:
IOException
-
getTcpNotSentLowAt
- Throws:
IOException
-
getTcpKeepIdle
- Throws:
IOException
-
getTcpKeepIntvl
- Throws:
IOException
-
getTcpKeepCnt
- Throws:
IOException
-
getTcpUserTimeout
- Throws:
IOException
-
isIpBindAddressNoPort
- Throws:
IOException
-
isIpFreeBind
- Throws:
IOException
-
isIpTransparent
- Throws:
IOException
-
isIpRecvOrigDestAddr
- Throws:
IOException
-
getPeerCredentials
- Throws:
IOException
-
isLoopbackModeDisabled
- Throws:
IOException
-
setLoopbackModeDisabled
- Throws:
IOException
-
isUdpGro
- Throws:
IOException
-
setUdpGro
- Throws:
IOException
-
sendFile
- Throws:
IOException
-
bindVSock
- Throws:
IOException
-
connectVSock
- Throws:
IOException
-
remoteVSockAddress
-
localVSockAddress
-
getIntAt
private static int getIntAt(byte[] array, int startIndex) -
deriveInetAddress
-
newSocket
-
newVSockStream
-
newVSockStream0
static int newVSockStream0() -
newSocketStream
-
newSocketStream
-
newSocketStream
-
newSocketDgram
-
newSocketDgram
-
newSocketDgram
-
newSocketDomain
-
newSocketDomainDgram
-
newVSockStreamFd
private static int newVSockStreamFd() -
bindVSock
private static int bindVSock(int fd, int cid, int port) -
connectVSock
private static int connectVSock(int fd, int cid, int port) -
remoteVSockAddress
private static byte[] remoteVSockAddress(int fd) -
localVSockAddress
private static byte[] localVSockAddress(int fd) -
joinGroup
private static void joinGroup(int fd, boolean ipv6, byte[] group, byte[] interfaceAddress, int scopeId, int interfaceIndex) throws IOException - Throws:
IOException
-
joinSsmGroup
private static void joinSsmGroup(int fd, boolean ipv6, byte[] group, byte[] interfaceAddress, int scopeId, int interfaceIndex, byte[] source) throws IOException - Throws:
IOException
-
leaveGroup
private static void leaveGroup(int fd, boolean ipv6, byte[] group, byte[] interfaceAddress, int scopeId, int interfaceIndex) throws IOException - Throws:
IOException
-
leaveSsmGroup
private static void leaveSsmGroup(int fd, boolean ipv6, byte[] group, byte[] interfaceAddress, int scopeId, int interfaceIndex, byte[] source) throws IOException - Throws:
IOException
-
sendFile
private static long sendFile(int socketFd, DefaultFileRegion src, long baseOffset, long offset, long length) throws IOException - Throws:
IOException
-
getTcpDeferAccept
- Throws:
IOException
-
isTcpQuickAck
- Throws:
IOException
-
isTcpCork
- Throws:
IOException
-
getSoBusyPoll
- Throws:
IOException
-
getTcpNotSentLowAt
- Throws:
IOException
-
getTcpKeepIdle
- Throws:
IOException
-
getTcpKeepIntvl
- Throws:
IOException
-
getTcpKeepCnt
- Throws:
IOException
-
getTcpUserTimeout
- Throws:
IOException
-
getTimeToLive
- Throws:
IOException
-
isIpBindAddressNoPort
- Throws:
IOException
-
isIpFreeBind
- Throws:
IOException
-
isIpTransparent
- Throws:
IOException
-
isIpRecvOrigDestAddr
- Throws:
IOException
-
getTcpInfo
- Throws:
IOException
-
getPeerCredentials
- Throws:
IOException
-
setTcpDeferAccept
- Throws:
IOException
-
setTcpQuickAck
- Throws:
IOException
-
setTcpCork
- Throws:
IOException
-
setSoBusyPoll
- Throws:
IOException
-
setTcpNotSentLowAt
- Throws:
IOException
-
setTcpFastOpen
- Throws:
IOException
-
setTcpKeepIdle
- Throws:
IOException
-
setTcpKeepIntvl
- Throws:
IOException
-
setTcpKeepCnt
- Throws:
IOException
-
setTcpUserTimeout
- Throws:
IOException
-
setIpBindAddressNoPort
- Throws:
IOException
-
setIpFreeBind
- Throws:
IOException
-
setIpTransparent
- Throws:
IOException
-
setIpRecvOrigDestAddr
- Throws:
IOException
-
setTcpMd5Sig
private static void setTcpMd5Sig(int fd, boolean ipv6, byte[] address, int scopeId, byte[] key) throws IOException - Throws:
IOException
-
setInterface
private static void setInterface(int fd, boolean ipv6, byte[] interfaceAddress, int scopeId, int networkInterfaceIndex) throws IOException - Throws:
IOException
-
getInterface
private static int getInterface(int fd, boolean ipv6) -
getIpMulticastLoop
- Throws:
IOException
-
setIpMulticastLoop
- Throws:
IOException
-
setTimeToLive
- Throws:
IOException
-
isUdpGro
- Throws:
IOException
-
setUdpGro
- Throws:
IOException
-