ZMQ { public static void proxy(Socket frontend, Socket backend, Socket capture) { if (ZMQ.version_full() < ZMQ.make_version(3, 2, 2)) throw new UnsupportedOperationException(); run_proxy(frontend, backend, capture); }  static int getMajorVersion(); static int getMinorVersion(); static int getPatchVersion(); static int getFullVersion(); static int makeVersion(final int major, final int minor, final int patch); static String getVersionString(); static void proxy(Socket frontend, Socket backend, Socket capture); static int poll(PollItem[] items, long timeout); static int poll(PollItem[] items, int count, long timeout); static Context context(int ioThreads); static final int NOBLOCK; static final int DONTWAIT; static final int SNDMORE; static final int PAIR; static final int PUB; static final int SUB; static final int REQ; static final int REP; static final int DEALER; static final int XREQ; static final int ROUTER; static final int XREP; static final int PULL; static final int PUSH; static final int XPUB; static final int XSUB; static final int STREAM; static final int STREAMER; static final int FORWARDER; static final int QUEUE; @Deprecated
    static final int UPSTREAM; @Deprecated
    static final int DOWNSTREAM; static final int EVENT_CONNECTED; static final int EVENT_CONNECT_DELAYED; static final int EVENT_CONNECT_RETRIED; static final int EVENT_LISTENING; static final int EVENT_BIND_FAILED; static final int EVENT_ACCEPTED; static final int EVENT_ACCEPT_FAILED; static final int EVENT_CLOSED; static final int EVENT_CLOSE_FAILED; static final int EVENT_DISCONNECTED; static final int EVENT_MONITOR_STOPPED; static final int EVENT_ALL; }
@Test public void testProxy() throws Exception { if (ZMQ.getFullVersion() < ZMQ.make_version(3, 2, 2)) { return; } Context ctx = ZMQ.context(1); assert (ctx != null); Main mt = new Main(ctx); mt.start(); new Dealer(ctx, "AA").start(); new Dealer(ctx, "BB").start(); Thread.sleep(1000); Thread c1 = new Client(ctx, "X"); c1.start(); Thread c2 = new Client(ctx, "Y"); c2.start(); c1.join(); c2.join(); ctx.term(); }