import socket

HOST = '127.0.0.1'        # The remote host
PORT = 50002              # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))

s.send("taskCreated| -t90| -npPing| 0x01|\n")
s.send("messageSent| -t100| -npPing| 0x01| 12| Ping|\n")
s.send("messageReceived| -t110| -npPong| 0x02| 12| Ping|\n")
s.send("taskChangedState| -t120| -npPong| 0x02| PingReceived|\n")
s.send("semaphoreCreated| -ssem| 0x03|\n")
s.send("takeAttempt| -t130| -npPong| -ssem| 0x02| 0x03|\n")
s.send("takeSucceeded| -t140| -npPong| -ssem| 0x02| 0x03|\n")
s.send("information| -t145| -npPong| 0x02| My informal message here|\n")
s.send("timerStarted| -t150| -npPong| -TWait| 0x02| 0x04| 100|\n")
s.send("timerTimedOut| -t160| -zrer| -npPong| 0x02| 0x04|\n")
s.send("taskCreated| -t170| -c0x02| -nnewTask| 0x05|\n")
s.send("dummy| -t170| -c0x02| -nnewTask| 0x05|\n")
s.send("giveSem| -t180| -npPong| -ssem| 0x02| 0x03|\n")
s.send("takeAttempt| -t190|  0x05| 0x03|\n")
s.send("takeSucceeded| -t200|  0x05| 0x03|\n")
s.send("takeAttempt| -t210|  0x01| 0x03|\n")
s.send("timerStarted| -t220| -TWait2| 0x05| 0x06| 100|\n")
s.send("timerTimedOut| -t230| 0x05| 0x06|\n")
s.send("giveSem| -t240| 0x05| 0x03|\n")
s.send("takeSucceeded| -t250|  0x01| 0x03|\n")
s.send("taskDeleted| -t260| 0x05|\n")
s.send("waitingForAck|\n")

data = s.recv(1024)
s.close()
print '%s Received' %data
print 'Done'