# Collection of code snippets by Arne Vajhøj 
# (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
import zmq

def test(addr):
    ctx = zmq.Context()
    s = ctx.socket(zmq.REQ)
    s.connect(addr)
    reqmsg = "Python client"
    s.send_string(reqmsg)
    respmsg = s.recv_string()
    print(respmsg)

test("tcp://localhost:10001")
test("tcp://localhost:10002")
test("tcp://localhost:10003")
test("tcp://localhost:10004")
test("tcp://localhost:10005")
test("tcp://localhost:10006")
