Last active
July 12, 2017 08:16
-
-
Save h2suzuki/93d4a0d9f00c65dde61f3a7a1a7a89d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zmq | |
import time | |
# ZeroMQ のバックグラウンド・スレッドのコンテキスト | |
context = zmq.Context() | |
# このサーバは、ポート5556で待ちます | |
socket = context.socket(zmq.PUB) | |
socket.bind("tcp://*:5556") | |
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)) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment