Class TcpUtils
java.lang.Object
zmq.io.net.tcp.TcpUtils
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidenableIpv4Mapping(SelectableChannel channel) static AddressgetPeerIpAddress(SocketChannel channel) static booleansetIpTypeOfService(Channel channel, int tos) private static voidsetOption(Channel channel, TcpUtils.OptionSetter<Socket> setter) A single setter method, used when the option doesn't apply to aServerSocketprivate static voidsetOption(Channel channel, TcpUtils.OptionSetter<Socket> setter, TcpUtils.OptionSetter<ServerSocket> serverSetter) static booleansetReuseAddress(Channel channel, boolean reuse) static booleansetTcpReceiveBuffer(Channel channel, int rcvbuf) static booleansetTcpSendBuffer(Channel channel, int sndbuf) static voidtuneTcpKeepalives(SocketChannel channel, int tcpKeepAlive, int tcpKeepAliveCnt, int tcpKeepAliveIdle, int tcpKeepAliveIntvl) static voidtuneTcpSocket(SocketChannel channel) static voidunblockSocket(SelectableChannel... channels)
-
Constructor Details
-
TcpUtils
private TcpUtils()
-
-
Method Details
-
tuneTcpSocket
- Throws:
IOException
-
setTcpReceiveBuffer
-
setTcpSendBuffer
-
setIpTypeOfService
-
setReuseAddress
-
tuneTcpKeepalives
public static void tuneTcpKeepalives(SocketChannel channel, int tcpKeepAlive, int tcpKeepAliveCnt, int tcpKeepAliveIdle, int tcpKeepAliveIntvl) -
setOption
A single setter method, used when the option doesn't apply to aServerSocket- Parameters:
channel-setter-
-
setOption
private static void setOption(Channel channel, TcpUtils.OptionSetter<Socket> setter, TcpUtils.OptionSetter<ServerSocket> serverSetter) -
unblockSocket
- Throws:
IOException
-
enableIpv4Mapping
-
getPeerIpAddress
-