message_id = request['id']
method = request['method']
params = request.get('params',[])
+ #print request
result = ''
if method == 'numblocks.subscribe':
self.lock = threading.Lock()
self.numblocks_sub = None
self.addresses_sub = {}
+ print "new session", address
def stop(self):
self._connection.close()
# Possible race condition here by having session
# close connection?
# I assume Python connections are thread safe interfaces
- connection = session.connection()
try:
+ connection = session.connection()
connection.send(raw_response + "\n")
except:
session.stop()
def run(self):
while not self.shared.stopped():
if not self.update():
- self.session.stop()
break
while self.parse():