# 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

TOPIC = '1234'

ctx = zmq.Context()
s = ctx.socket(zmq.PUB)
s.bind("tcp://*:10005")
count = 0
while True:
    count = count + 1
    respmsg = "%s Python server (%d)" % (TOPIC, count)
    s.send_string(respmsg)
    time.sleep(3)
