Skip to content

Commit

Permalink
Stop loop on socket close
Browse files Browse the repository at this point in the history
  • Loading branch information
cpacia committed Dec 18, 2015
1 parent 95e7ed2 commit 0fa411e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions obelisk/zmq_fallback.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def connect(self, address):
self._socket.connect(address)
if self._type == zmq.SUB:
self._socket.setsockopt(zmq.SUBSCRIBE, '')
l = task.LoopingCall(self.poll)
l.start(0.1)
self.loop = task.LoopingCall(self.poll)
self.loop.start(0.1)

def poll(self):
# keep polling till we have no more data
Expand All @@ -46,4 +46,5 @@ def send(self, data, more=0):
self._socket.send(data, more)

def close(self):
self.loop.stop()
self._socket.close()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='python-libbitcoinclient',
version="0.3.0",
version="0.3.1",
install_requires=['twisted', 'ecdsa', 'pyzmq'],
packages=['obelisk'],
maintainer='Chris Pacia',
Expand Down

0 comments on commit 0fa411e

Please sign in to comment.