[zeromq-dev] Multicast and wlan0
Will Heger
will.heger at gmail.com
Thu Sep 6 20:29:20 CEST 2012
So I've just started working with (er attempting) epgm and I haven't been
able to read a single message yet. Other patterns like request-reply have
worked fine. The pyzmq test code (stolen from
http://code.saghul.net/implementing-a-pubsub-based-application-with) is
listed below and below that is my ifconfig. I'm on ZMQ 2.2 with-pgm
compiled.
So my questions are as follows:
1. should the code below, 'just work' (tm) as in pick a 239.192 address and
go?
2. My aim is to use epgm for LAN network discovery among different wireless
devices. The LANs I will deploy on will be pretty generic home networks.
I write this because I'm unclear if that's even a reliable strategy or if
there is some additional network provisioning that might need to be
performed. I'll do UDP broadcast and/or scanning if it comes to it, but
this seemed smarter.
3. Finally, a side question (I believe). I've tried to use "wlan0" to
explicitly declare what network interface I want to use (as in tcp://wlan0;
192.168.1.1:5000) and that never works, although omitting the interface
works fine for request-reply.
# producer
import zmq
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.setsockopt(zmq.LINGER, 0) # discard unsent messages on close
socket.connect('epgm://239.192.1.1:5000')
while True:
msg = raw_input('> ')
if msg == 'quit':
break
else:
socket.send(msg)
socket.close()
# consumer
import zmq
context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.connect('epgm://239.192.1.1:5000')
socket.setsockopt(zmq.SUBSCRIBE, 'test')
socket.setsockopt(zmq.SUBSCRIBE, 'topic_1')
while True:
data = socket.recv()
print data
---------------
eth0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:18
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:187 errors:0 dropped:0 overruns:0 frame:0
TX packets:187 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:24696 (24.1 KiB) TX bytes:24696 (24.1 KiB)
wlan0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
inet addr:192.168.2.100 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: XXXX::XXXX:XXXX:XXXX:XXX/XX Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:139760 errors:0 dropped:0 overruns:0 frame:0
TX packets:101421 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:163638433 (156.0 MiB) TX bytes:15775138 (15.0 MiB)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120906/24442ea2/attachment.htm>
More information about the zeromq-dev
mailing list