Open peetonn opened 6 years ago
Seems to be working just fine, you're just missing the subscribe definition:
>>> import nanomsg
>>> nanomsg.__version__
'1.0'
>>> from nanomsg import Socket, PUB, SUB
>>> p = Socket(PUB)
>>> p.bind(b"ipc://test")
<BindEndpoint socket <Socket fd 0, connected to [b'ipc://test'], bound to []>, id 1, addresss b'ipc://test'>
>>> p.send(b"test")
>>> from nanomsg import Socket, PUB, SUB, SUB_SUBSCRIBE
>>> s = Socket(SUB)
>>> s.connect(b"ipc://test")
<ConnectEndpoint socket <Socket fd 0, connected to [], bound to [b'ipc://test']>, id 1, addresss b'ipc://test'>
>>> s.set_string_option(SUB, SUB_SUBSCRIBE, b'')
>>> s.recv()
b'test'
Tested with Windows 7. Checkout nanomsg tests for more examples: https://github.com/tonysimpson/nanomsg-python/tree/master/tests
Trying to test with IPC protocol, but messages are never received:
publisher:
subscriber:
Is there anything Python-specific for IPC I'm missing out here? I tried nnpy - it doesn't work either.