[zeromq-dev] jzmq router socket unable to bind to address

starkdg at comcast.net starkdg at comcast.net
Sat Nov 2 23:04:48 CET 2013


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); 
} 
} 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20131102/89e30af5/attachment.html>


More information about the zeromq-dev mailing list