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

import zmq

def test(addr):
    ctx = zmq.Context()
    s = ctx.socket(zmq.PUSH)
    s.connect(addr)
    for i in range(3):
        reqmsg = "Python client"
        s.send_string(reqmsg)
    time.sleep(1)

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