pyzmq pubsub: Can't cleanup Device so `Address already in use`

17 views
Skip to first unread message

Mazzaroth M.

unread,
Jun 11, 2016, 5:59:19 PM6/11/16
to zeromq

I'm making a pyzmq app which uses the publisher-subscribe paradigm and it works fine as separate python scripts but I'd like to turn them into Python classes.

Seems to kinda work but when I setup the zeromq device in the controller class, I'm not able to cleanup the port and on next run I get the `Address already in use` error on startup. I believe that I'm not able to cleanup the device when I quit the controller. It may be quite simple:


https://bitbucket.org/sidha/twitpub/commits/c9d047f5eca4d03fe30f8d844bd367c0894fa47d?at=master#chg-twitpub/controller.py


how do I cleanup the Device object on a keyboard interrupt? I initiate the app from a run script:


https://bitbucket.org/sidha/twitpub/src/c9d047f5eca4d03fe30f8d844bd367c0894fa47d/twitpub/run?fileviewer=file-view-default


Any help or suggestions would be great appreciated.


Michael


Reply all
Reply to author
Forward
0 new messages