public class TcpUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
enableIpv4Mapping(SelectableChannel channel) |
static Address |
getPeerIpAddress(SocketChannel channel) |
static boolean |
setIpTypeOfService(Channel channel,
int tos) |
static boolean |
setReuseAddress(Channel channel,
boolean reuse) |
static boolean |
setTcpReceiveBuffer(Channel channel,
int rcvbuf) |
static boolean |
setTcpSendBuffer(Channel channel,
int sndbuf) |
static void |
tuneTcpKeepalives(SocketChannel channel,
int tcpKeepAlive,
int tcpKeepAliveCnt,
int tcpKeepAliveIdle,
int tcpKeepAliveIntvl) |
static void |
tuneTcpSocket(SocketChannel channel) |
static void |
unblockSocket(SelectableChannel... channels) |
public static void tuneTcpSocket(SocketChannel channel) throws IOException
IOExceptionpublic static void tuneTcpKeepalives(SocketChannel channel, int tcpKeepAlive, int tcpKeepAliveCnt, int tcpKeepAliveIdle, int tcpKeepAliveIntvl) throws IOException
IOExceptionpublic static boolean setTcpReceiveBuffer(Channel channel, int rcvbuf)
public static boolean setTcpSendBuffer(Channel channel, int sndbuf)
public static boolean setIpTypeOfService(Channel channel, int tos)
public static boolean setReuseAddress(Channel channel, boolean reuse)
public static void unblockSocket(SelectableChannel... channels) throws IOException
IOExceptionpublic static void enableIpv4Mapping(SelectableChannel channel)
public static Address getPeerIpAddress(SocketChannel channel)
Copyright © 2020. All rights reserved.