import zmq

def client(server_url="tcp://localhost:4444"):
    context = zmq.Context()
    socket = context.socket(zmq.REQ)
    # socket.setsockopt(zmq.IDENTITY, "client_id_abc") # see Conclusions
    socket.connect(server_url)

    for i in range(5):
        print("request %s" % i)
        socket.send(str(i))
        res = socket.recv()
        print("%s result: %s" % (i, res))

if __name__ == "__main__":
    client()
