Package zmq.io.net.tcp
Class TcpUtils
java.lang.Object
zmq.io.net.tcp.TcpUtils
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
enableIpv4Mapping
(SelectableChannel channel) static Address
getPeerIpAddress
(SocketChannel channel) static boolean
setIpTypeOfService
(Channel channel, int tos) private static void
setOption
(Channel channel, TcpUtils.OptionSetter<Socket> setter) A single setter method, used when the option doesn't apply to aServerSocket
private static void
setOption
(Channel channel, TcpUtils.OptionSetter<Socket> setter, TcpUtils.OptionSetter<ServerSocket> serverSetter) 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)
-
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
-