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

ctx = zmq.Context()
s = ctx.socket(zmq.REP)
s.bind("tcp://*:10005")
while True:
    reqmsg = s.recv_string()
    respmsg = reqmsg + " - Python server"
    s.send_string(respmsg)
