PUB/SUB over IPC を実現しようとしています。サブスクライバーが「tcp://*:5000」にバインドし、パブリッシャーが「tcp://localhost:5000」に接続するように以下のコードを変更すると、動作しますが、IPC 経由で動作させることはできません。私は何を間違っていますか?
サブスクライバー.py
import zmq, json
def main():
context = zmq.Context()
subscriber = context.socket(zmq.SUB)
subscriber.bind("ipc://test")
subscriber.setsockopt(zmq.SUBSCRIBE, '')
while True:
print subscriber.recv()
if __name__ == "__main__":
main()
出版社.py
import zmq, json, time
def main():
context = zmq.Context()
publisher = context.socket(zmq.PUB)
publisher.connect("ipc://test")
while True:
publisher.send( "hello world" )
time.sleep( 1 )
if __name__ == "__main__":
main()