zeromq/pyzmq — Issue #149: LINGER Not Working for Device
Author: espeed
Created: 2011-10-21 09:47:24+00:00
State: open

With this simple STREAMER device, sometimes it will print that it receives all 1000 messages, sometimes it will be ~300, sometimes more or less -- it's so intermittent as to how many messages it receives.

https://gist.github.com/1302163

However, if you uncomment the time.sleep(5) line at the end of the client(), it keeps the client open long enough for the socket to finish sending the messages to the worker and prints that it received all 1000 messages.

This looks like LINGER may not be working in the device.

It usually runs fine the first time, but subsequent times it still comes up short:

$ python device_test.py
...
0 got message! #734
0 got message! #735
0 got message! #736
0 got message! #737
0 got message! #738

I have tested this with pyzmq 2.1.9 and the latest GitHub version on both Fedora and Ubuntu with ZMQ 2.1.4 and 2.1.11.