Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import zmq
import time
# ZeroMQ のバックグラウンド・スレッドのコンテキスト
context = zmq.Context()
# このサーバは、ポート5556で待ちます
socket = context.socket(zmq.PUB)
i = 0
while True:
i += 1
for ch in range(1,4):
data = ch * i
socket.send_string("{0} {1}".format(ch, data))
print("Ch {0} <- {1} sent".format(ch, data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment