Hi all!

I am trying to bind a socket (I tryed type XREP and PUB since I use both) to more than one endpoint, but get errors. As I understand it, the documentation says its OK.
The final goal is to bind once to a tcp:// and the second time to an inproc://, but since that failed, I stripped it down to two bindings using the same protocol in case, tcp and inproc doesn't work together in one socket, but whatever I try, the second bind() says "Address already in use" ;o(
Below you find a small snippet of the log-output and the causing code (in this case an XREP socket was used, but PUB behaves identically).
The second bind() throws whenever more than one endpoint is configured and I need multiple ones, because clients/clientservices connect via different interfaces (DB from internal NIC, Workers from localhost and private NIC and clients via DMZ-interface).
What am I making wrong?

rgds
sven

[9360 9361] DEBUG (          ../source/services/Service.cpp: 437) Service - binding service socket to endpoint "tcp://127.0.0.1:8000"
[9360 9361] DEBUG (          ../source/services/Service.cpp: 444) Service - added global dispatcher connection tcp://127.0.0.1:8000
[9360 9361] DEBUG (          ../source/services/Service.cpp: 437) Service - binding service socket to endpoint "tcp://192.168.2.41:9000"
[9360 9361] FATAL (          ../source/services/Service.cpp: 404) Service - dispatcher device creation failed with message: Address already in use

431        for (uint i=0; i<hosts.size(); i++) {
432            stringstream str; string sn;
433            str << "tcp://" << (hosts[i]) <<
434                    ":" << (ports[i]+(go.intOption("port_offset")+instance_offset));
435            str >> sn;
436            if (clients) {
437                logDebug("binding service socket to endpoint \""<<sn<<"\"");
438                clients->bind (sn.c_str());
439            }
440            if (msg) msg->add_gnrl_str_list(sn); // insert endpoint in registering message for dispatcher
441            if (useNormalPort) ownState.addEndpoint(sn); // no PUB ports in ownState, only XREP!
442            if (getTypeName() == "dispatcher" && useNormalPort) {
443                    rep_endpoints()->insert(sn); // segfault for all but dispatcher srvc !
444                    logDebug("added global dispatcher connection "<<sn);
445            }
446        }
  

Neu: WEB.DE De-Mail - Einfach wie E-Mail, sicher wie ein Brief!    
Jetzt De-Mail-Adresse reservieren: https://produkte.web.de/go/demail02
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to