[zeromq-dev] binding to all interfaces

Steve Murphy murf at parsetree.com
Fri Aug 1 18:01:16 CEST 2014


Hello--

I've been playing around with the
bind calls, and I discover that I can't
use the '*' to bind to all interfaces, as
the documentation suggests.

I'm on linux, centos 6.5, and on ubuntu 14.04, czmq 2.2.0 and zeromq-4.0.4,
but
this seems to have been the case for several older versions...

Is this some OS dependent sort of thing?

zctx_t *ctx = zctx_new();
void *sport = zsocket_new(ctx, ZMQ_REP);
int pnum = zsocket_bind(sport, "tcp://
​​
​*:%d",
​34444);

gives me a pnum of -1

So do these:
int pnum = zsocket_bind(sport, "tcp://0.0.0.0:%d",
​34444);

int pnum = zsocket_bind(sport, "tcp:/// :%d",
​34444);

(for that last one, see the example usage on api.zeromq.org/3-2:zmq-tcp;
that page may need debugging)

but this works:

int pnum = zsocket_bind(sport, "tcp://
​​
​192.168.1.2:%d",
​34444);


So, what am I not understanding?

murf


-- 

Steve Murphy
ParseTree Corporation
57 Lane 17
Cody, WY 82414
✉  murf at parsetree dot com
☎ 307-899-5535
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140801/2323e4f0/attachment.html>


More information about the zeromq-dev mailing list