Hello folks,
I have been updating some code to use the newer
zeromq 3.2 library (from the legacy 2.2 version). However,
it runs into a run-time error when trying to bind a router socket
to an address. I have reduced the problem to the code below.
Beforehand, It was using a pair of XREP/XREQ sockets in a queue device, feeding
it to several
worker threads, each with a REP socket. (The client app used a REQ socket.)
This seemed
to work fine, but I read in the guide about the ROUTER/DEALER proxy
functionality, so I've
been trying to replicate that. The code below compiles fine. Why does it fail
when binding to the
address?
The following describes where it fails:
Problematic frame:
# C [libzmq.so.3+0x27c90] zmq::signaler_t::signaler_t()+0x80
Thanks for your help.
David Starkweather
import org.zeromq.ZContext;
import org.zeromq.ZMQ;
import org.zeromq.ZMQ.Socket;
import org.zeromq.ZMQQueue;
public class TestJZMQ {
public static void main(String[] args){
String addr = "tcp://*:4005";
String inprocaddr = "inproc://link";
// setup messaging
ZContext zmqctx = new ZContext();
zmqctx.setIoThreads(1);
System.out.println("Create front socket");
Socket frontSocket = zmqctx.createSocket(ZMQ.ROUTER);
System.out.println("Bind to " + addr);
frontSocket.bind(addr);
System.out.println("Create back socket");
Socket backSocket = zmqctx.createSocket(ZMQ.DEALER);
System.out.println("bind to " + inprocaddr);
backSocket.bind(inprocaddr);
ZMQ.proxy(frontSocket, backSocket, null);
}
} _______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev