Package zmq

Class ZMQ


  • public class ZMQ
    extends java.lang.Object
    • Constructor Detail

      • ZMQ

        public ZMQ()
    • Method Detail

      • createContext

        public static Ctx createContext()
      • checkContext

        private static void checkContext​(Ctx ctx)
      • destroyContext

        private static void destroyContext​(Ctx ctx)
      • setContextOption

        public static void setContextOption​(Ctx ctx,
                                            int option,
                                            int optval)
      • getContextOption

        public static int getContextOption​(Ctx ctx,
                                           int option)
      • init

        public static Ctx init​(int ioThreads)
      • term

        public static void term​(Ctx ctx)
      • socket

        public static SocketBase socket​(Ctx ctx,
                                        int type)
      • checkSocket

        private static void checkSocket​(SocketBase s)
      • closeZeroLinger

        public static void closeZeroLinger​(SocketBase s)
      • close

        public static void close​(SocketBase s)
      • setSocketOption

        public static boolean setSocketOption​(SocketBase s,
                                              int option,
                                              java.lang.Object optval)
      • getSocketOptionExt

        public static java.lang.Object getSocketOptionExt​(SocketBase s,
                                                          int option)
      • getSocketOption

        public static int getSocketOption​(SocketBase s,
                                          int opt)
      • monitorSocket

        public static boolean monitorSocket​(SocketBase s,
                                            java.lang.String addr,
                                            int events)
      • bind

        public static boolean bind​(SocketBase s,
                                   java.lang.String addr)
      • connect

        public static boolean connect​(SocketBase s,
                                      java.lang.String addr)
      • connectPeer

        public static int connectPeer​(SocketBase s,
                                      java.lang.String addr)
      • disconnectPeer

        public static boolean disconnectPeer​(SocketBase s,
                                             int routingId)
      • unbind

        public static boolean unbind​(SocketBase s,
                                     java.lang.String addr)
      • disconnect

        public static boolean disconnect​(SocketBase s,
                                         java.lang.String addr)
      • send

        public static int send​(SocketBase s,
                               java.lang.String str,
                               int flags)
      • send

        public static int send​(SocketBase s,
                               Msg msg,
                               int flags)
      • send

        public static int send​(SocketBase s,
                               byte[] buf,
                               int flags)
      • send

        public static int send​(SocketBase s,
                               byte[] buf,
                               int len,
                               int flags)
      • sendiov

        public int sendiov​(SocketBase s,
                           byte[][] a,
                           int count,
                           int flags)
      • sendMsg

        public static boolean sendMsg​(SocketBase socket,
                                      byte[]... data)
      • sendMsg

        public static int sendMsg​(SocketBase s,
                                  Msg msg,
                                  int flags)
      • recviov

        public int recviov​(SocketBase s,
                           byte[][] a,
                           int count,
                           int flags)
      • recvMsg

        public static Msg recvMsg​(SocketBase s,
                                  int flags)
      • join

        public static boolean join​(SocketBase s,
                                   java.lang.String group)
      • leave

        public static boolean leave​(SocketBase s,
                                    java.lang.String group)
      • msgInit

        public static Msg msgInit()
      • msgInitWithSize

        public static Msg msgInitWithSize​(int messageSize)
      • msgSize

        public static int msgSize​(Msg msg)
      • getMessageOption

        public static int getMessageOption​(Msg msg,
                                           int option)
      • getMessageMetadata

        public static java.lang.String getMessageMetadata​(Msg msg,
                                                          java.lang.String property)
      • setMessageRoutingId

        public boolean setMessageRoutingId​(Msg msg,
                                           int routingId)
      • getMessageRoutingId

        public int getMessageRoutingId​(Msg msg)
      • setMessageGroup

        public boolean setMessageGroup​(Msg msg,
                                       java.lang.String group)
      • getMessageGroup

        public java.lang.String getMessageGroup​(Msg msg)
      • sleep

        public static void sleep​(long seconds)
      • msleep

        public static void msleep​(long milliseconds)
      • sleep

        public static void sleep​(long amount,
                                 java.util.concurrent.TimeUnit unit)
      • poll

        public static int poll​(java.nio.channels.Selector selector,
                               PollItem[] items,
                               long timeout)
        Polling on items with given selector CAUTION: This could be affected by jdk epoll bug
        Parameters:
        selector - Open and reuse this selector and do not forget to close when it is not used.
        items -
        timeout -
        Returns:
        number of events
      • poll

        public static int poll​(java.nio.channels.Selector selector,
                               PollItem[] items,
                               int count,
                               long timeout)
        Polling on items with given selector CAUTION: This could be affected by jdk epoll bug
        Parameters:
        selector - Open and reuse this selector and do not forget to close when it is not used.
        items -
        count -
        timeout -
        Returns:
        number of events
      • startStopwatch

        public static long startStopwatch()
      • stopStopwatch

        public static long stopStopwatch​(long watch)
      • makeVersion

        public static int makeVersion​(int major,
                                      int minor,
                                      int patch)
      • strerror

        public static java.lang.String strerror​(int errno)