[zeromq-dev] PyZMQ w/ 0mq 3.x
Jason .
dn1nj4 at gmail.com
Fri Sep 14 11:29:33 CEST 2012
Hi All,
I am looking at migrating from pyzmq with 0mq v2.2 to pyzmq with 0mq
3.x and am having some very basic issues I'm hoping someone can shed
some insight into. For testing, I am looking at the wuserver/wuclient
PUB/SUB examples found in the python 0mq guide.
With 0mq 2.2 these examples work fine for me. But when I upgrade to
3.x, the client appears to only receives empty messages. I am
currently running on Ubuntu 12.04.
> python -c 'import zmq; print zmq.zmq_version()'
3.2.0
The client appears to connect:
> netstat -anl
tcp 0 0 0.0.0.0:5556 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:50695 127.0.0.1:5556 ESTABLISHED
I added in print messages for both the client and server to show every
message sent & received and commented out the post-receive processing:
wuserver:
message = "%d %d %d" % (zipcode, temperature, relhumidity)
print 'Sending %s' % message
socket.send(message)
wuclient:
socket.setsockopt(zmq.SUBSCRIBE,'')
...
print 'Received: -%s-' % string
#zipcode, temperature, relhumidity = string.split()
#total_temp += int(temperature)
The server side claims to be sending messages:
Sending 86498 -31 49
Sending 62351 21 27
Sending 30750 68 42
Sending 57048 50 50
Sending 2616 -72 43
And the client receives something, but no idea what:
Collecting updates from weather server
Received: --
Received: --
Received: --
Received: --
Received: --
If you have any suggestions, I would greatly appreciate it.
Thanks!
Jason
More information about the zeromq-dev
mailing list