Unverified Commit 51347acf authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Make zmqsend port optional

parent 3a8c5691
#!/usr/bin/env python
#!/usr/bin/env python3
import zmq
import sys
......@@ -6,12 +6,14 @@ import time
import numpy as np
from numpy.random import random
port = sys.argv[1]
if len(sys.argv) > 0:
port = sys.argv[1]
else:
port = "5557"
ctx = zmq.Context()
sender = ctx.socket(zmq.PUSH)
sender.bind("tcp://127.0.0.1:5557")
sender.bind("tcp://127.0.0.1:" + port)
while True:
time.sleep(0.5)
sender.send(np.array(3000 + random() * 500, dtype="float32"))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment