Package io.netty.channel.unix
Class Socket
- java.lang.Object
-
- io.netty.channel.unix.FileDescriptor
-
- io.netty.channel.unix.Socket
-
public class Socket extends FileDescriptor
Provides a JNI bridge to native socket operations. Internal usage only!
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
ipv6
static int
UDS_SUN_PATH_SIZE
Deprecated.
-
Constructor Summary
Constructors Constructor Description Socket(int fd)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
accept(byte[] addr)
void
bind(SocketAddress socketAddress)
boolean
connect(SocketAddress socketAddress)
void
disconnect()
boolean
finishConnect()
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()
static Socket
newSocketDgram()
protected static int
newSocketDgram0()
protected static int
newSocketDgram0(boolean ipv6)
static Socket
newSocketDomain()
protected static int
newSocketDomain0()
static Socket
newSocketStream()
protected static int
newSocketStream0()
protected static int
newSocketStream0(boolean ipv6)
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
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
sendToAddresses(long memoryAddress, int length, InetAddress addr, int port)
int
sendToAddresses(long memoryAddress, int length, InetAddress addr, int port, boolean fastOpen)
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()
-
Methods inherited from class io.netty.channel.unix.FileDescriptor
close, 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
-
ipv6
protected final boolean ipv6
-
-
Method Detail
-
shutdown
public final void shutdown() throws IOException
- Throws:
IOException
-
shutdown
public final void shutdown(boolean read, boolean write) throws IOException
- Throws:
IOException
-
isShutdown
public final boolean isShutdown()
-
isInputShutdown
public final boolean isInputShutdown()
-
isOutputShutdown
public final boolean isOutputShutdown()
-
sendTo
public final int sendTo(ByteBuffer buf, int pos, int limit, InetAddress addr, int port) throws IOException
- Throws:
IOException
-
sendTo
public final int sendTo(ByteBuffer buf, int pos, int limit, InetAddress addr, int port, boolean fastOpen) throws IOException
- Throws:
IOException
-
sendToAddress
public final int sendToAddress(long memoryAddress, int pos, int limit, InetAddress addr, int port) throws IOException
- Throws:
IOException
-
sendToAddress
public final int sendToAddress(long memoryAddress, int pos, int limit, InetAddress addr, int port, boolean fastOpen) throws IOException
- Throws:
IOException
-
sendToAddresses
public final int sendToAddresses(long memoryAddress, int length, InetAddress addr, int port) throws IOException
- Throws:
IOException
-
sendToAddresses
public final int sendToAddresses(long memoryAddress, int length, InetAddress addr, int port, boolean fastOpen) throws IOException
- Throws:
IOException
-
recvFrom
public final DatagramSocketAddress recvFrom(ByteBuffer buf, int pos, int limit) throws IOException
- Throws:
IOException
-
recvFromAddress
public final DatagramSocketAddress recvFromAddress(long memoryAddress, int pos, int limit) throws IOException
- Throws:
IOException
-
recvFd
public final int recvFd() throws IOException
- Throws:
IOException
-
sendFd
public final int sendFd(int fdToSend) throws IOException
- Throws:
IOException
-
connect
public final boolean connect(SocketAddress socketAddress) throws IOException
- Throws:
IOException
-
finishConnect
public final boolean finishConnect() throws IOException
- Throws:
IOException
-
disconnect
public final void disconnect() throws IOException
- Throws:
IOException
-
bind
public final void bind(SocketAddress socketAddress) throws IOException
- Throws:
IOException
-
listen
public final void listen(int backlog) throws IOException
- Throws:
IOException
-
accept
public final int accept(byte[] addr) throws IOException
- Throws:
IOException
-
remoteAddress
public final InetSocketAddress remoteAddress()
-
localAddress
public final InetSocketAddress localAddress()
-
getReceiveBufferSize
public final int getReceiveBufferSize() throws IOException
- Throws:
IOException
-
getSendBufferSize
public final int getSendBufferSize() throws IOException
- Throws:
IOException
-
isKeepAlive
public final boolean isKeepAlive() throws IOException
- Throws:
IOException
-
isTcpNoDelay
public final boolean isTcpNoDelay() throws IOException
- Throws:
IOException
-
isReuseAddress
public final boolean isReuseAddress() throws IOException
- Throws:
IOException
-
isReusePort
public final boolean isReusePort() throws IOException
- Throws:
IOException
-
isBroadcast
public final boolean isBroadcast() throws IOException
- Throws:
IOException
-
getSoLinger
public final int getSoLinger() throws IOException
- Throws:
IOException
-
getSoError
public final int getSoError() throws IOException
- Throws:
IOException
-
getTrafficClass
public final int getTrafficClass() throws IOException
- Throws:
IOException
-
setKeepAlive
public final void setKeepAlive(boolean keepAlive) throws IOException
- Throws:
IOException
-
setReceiveBufferSize
public final void setReceiveBufferSize(int receiveBufferSize) throws IOException
- Throws:
IOException
-
setSendBufferSize
public final void setSendBufferSize(int sendBufferSize) throws IOException
- Throws:
IOException
-
setTcpNoDelay
public final void setTcpNoDelay(boolean tcpNoDelay) throws IOException
- Throws:
IOException
-
setSoLinger
public final void setSoLinger(int soLinger) throws IOException
- Throws:
IOException
-
setReuseAddress
public final void setReuseAddress(boolean reuseAddress) throws IOException
- Throws:
IOException
-
setReusePort
public final void setReusePort(boolean reusePort) throws IOException
- Throws:
IOException
-
setBroadcast
public final void setBroadcast(boolean broadcast) throws IOException
- Throws:
IOException
-
setTrafficClass
public final void setTrafficClass(int trafficClass) throws IOException
- Throws:
IOException
-
isIPv6Preferred
public static boolean isIPv6Preferred()
-
toString
public String toString()
- Overrides:
toString
in classFileDescriptor
-
newSocketStream
public static Socket newSocketStream()
-
newSocketDgram
public static Socket newSocketDgram()
-
newSocketDomain
public static Socket newSocketDomain()
-
initialize
public static void initialize()
-
newSocketStream0
protected static int newSocketStream0()
-
newSocketStream0
protected static int newSocketStream0(boolean ipv6)
-
newSocketDgram0
protected static int newSocketDgram0()
-
newSocketDgram0
protected static int newSocketDgram0(boolean ipv6)
-
newSocketDomain0
protected static int newSocketDomain0()
-
-