Hi,
I want to try pubsub.py example, but the script fails silently.
Obelisk and SX works well (i can see that in the debug.log).
But when i try this simple code :
if __name__ == '__main__':
c = obelisk.ClientBase('tcp://127.0.0.1:9091', 'tcp://127.0.0.1:9093', 'tcp://127.0.0.1:9094')
reactor.run()
But i obtain nothing! only silence..
I put some "print" in zmqbase, and it seems that the script connect well but don't receive anything.
~/python-obelisk$ python pubsub.py
init start
setup:
<obelisk.zmq_fallback.ZmqSocket instance at 0x2681878>
setup_block_sub:
<obelisk.zmq_fallback.ZmqSocket instance at 0x2681a70>
setup_transaction_sub:
<obelisk.zmq_fallback.ZmqSocket instance at 0x2681b90>
init end
and after that nothing..
i try with python-zmq and zmqproto but it's the same..
How i can diagnose what happen here ?
Thank you very much for your help.
BTW: i needed to correct the zmq_fallback to work with python-zmq and type='SUB'. I will make a pull request this week:
...
class ZmqSocket:
context = zmq.Context(1)
def __init__(self, cb, version, type = zmq.DEALER):
self._cb = cb
self._type = type
[b]if self._type=='SUB':
self._type = zmq.PUB[/b]
def connect(self, address):
self._socket = ZmqSocket.context.socket(self._type)
self._socket.connect(address)
l = task.LoopingCall(self.poll)
l.start(0.1)
...
I just add the parameters type to the constructor.
Edit:
with netstat i can see that connection established :
/home/obelisk# netstat --inet
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 localhost.localdom:9094 localhost.localdo:36606 ESTABLISHED
tcp 0 0 localhost.localdo:40484 localhost.localdom:9091 ESTABLISHED
tcp 0 0 localhost.localdo:40472 localhost.localdom:9091 TIME_WAIT
tcp 13415 0 localhost.localdo:36606 localhost.localdom:9094 ESTABLISHED
tcp 0 0 localhost.localdom:9093 localhost.localdo:49661 ESTABLISHED
tcp 0 0 localhost.localdom:9091 localhost.localdo:40484 ESTABLISHED
tcp 0 0 localhost.localdo:40113 localhost.localdom:9092 ESTABLISHED
tcp 0 0 localhost.localdo:49661 localhost.localdom:9093 ESTABLISHED