Class TcpUtils

java.lang.Object
zmq.io.net.tcp.TcpUtils

public class TcpUtils extends Object
  • Field Details

    • WITH_EXTENDED_KEEPALIVE

      public static final boolean WITH_EXTENDED_KEEPALIVE
  • Constructor Details

    • TcpUtils

      private TcpUtils()
  • Method Details

    • tuneTcpSocket

      public static void tuneTcpSocket(Channel channel) throws IOException
      Throws:
      IOException
    • tuneTcpKeepalives

      public static void tuneTcpKeepalives(Channel channel, int tcpKeepAlive, int tcpKeepAliveCnt, int tcpKeepAliveIdle, int tcpKeepAliveIntvl)
    • setTcpReceiveBuffer

      public static boolean setTcpReceiveBuffer(Channel channel, int rcvbuf)
    • setTcpSendBuffer

      public static boolean setTcpSendBuffer(Channel channel, int sndbuf)
    • setIpTypeOfService

      public static boolean setIpTypeOfService(Channel channel, int tos)
    • setReuseAddress

      public static boolean setReuseAddress(Channel channel, boolean reuse)
    • setOption

      private static <T> void setOption(Channel channel, SocketOption<T> option, T value)
    • unblockSocket

      public static void unblockSocket(SelectableChannel... channels) throws IOException
      Throws:
      IOException
    • enableIpv4Mapping

      public static void enableIpv4Mapping(SelectableChannel channel)
    • getPeerIpAddress

      @Deprecated public static Address getPeerIpAddress(SocketChannel channel)
      Deprecated.
      Return the Address of the channel
      Parameters:
      channel - the channel, should be a TCP socket channel
      Returns:
      The Address of the channel
      Throws:
      ZError.IOException - if the channel is closed or an I/O errors occurred
      IllegalArgumentException - if the SocketChannel is not a TCP channel