Package zmq.io.net.tcp
Class TcpUtils
java.lang.Object
zmq.io.net.tcp.TcpUtils
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidenableIpv4Mapping(SelectableChannel channel) static AddressgetPeerIpAddress(SocketChannel channel) Deprecated.static booleansetIpTypeOfService(Channel channel, int tos) private static <T> voidsetOption(Channel channel, SocketOption<T> option, T value) static booleansetReuseAddress(Channel channel, boolean reuse) static booleansetTcpReceiveBuffer(Channel channel, int rcvbuf) static booleansetTcpSendBuffer(Channel channel, int sndbuf) static voidtuneTcpKeepalives(Channel channel, int tcpKeepAlive, int tcpKeepAliveCnt, int tcpKeepAliveIdle, int tcpKeepAliveIntvl) static voidtuneTcpSocket(Channel channel) static voidunblockSocket(SelectableChannel... channels)
-
Field Details
-
WITH_EXTENDED_KEEPALIVE
public static final boolean WITH_EXTENDED_KEEPALIVE
-
-
Constructor Details
-
TcpUtils
private TcpUtils()
-
-
Method Details
-
tuneTcpSocket
- Throws:
IOException
-
tuneTcpKeepalives
public static void tuneTcpKeepalives(Channel channel, int tcpKeepAlive, int tcpKeepAliveCnt, int tcpKeepAliveIdle, int tcpKeepAliveIntvl) -
setTcpReceiveBuffer
-
setTcpSendBuffer
-
setIpTypeOfService
-
setReuseAddress
-
setOption
-
unblockSocket
- Throws:
IOException
-
enableIpv4Mapping
-
getPeerIpAddress
Deprecated.UseUtils.getPeerIpAddress(SocketChannel)insteadReturn theAddressof the channel- Parameters:
channel- the channel, should be a TCP socket channel- Returns:
- The
Addressof the channel - Throws:
ZError.IOException- if the channel is closed or an I/O errors occurredIllegalArgumentException- if the SocketChannel is not a TCP channel
-
Utils.getPeerIpAddress(SocketChannel)instead