From cd8951df52d512766d9244bc41edd954838f7053 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Fri, 15 Jun 2012 10:19:06 -0400 Subject: [PATCH] a python client, too. why not? --- ruby-sockets/ping-pong-client.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 ruby-sockets/ping-pong-client.py diff --git a/ruby-sockets/ping-pong-client.py b/ruby-sockets/ping-pong-client.py new file mode 100644 index 0000000..39170a0 --- /dev/null +++ b/ruby-sockets/ping-pong-client.py @@ -0,0 +1,11 @@ +import socket +import sys +import time + + +while True: + client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + client.connect(('localhost', 24000)) + client.send('PING\n') + sys.stdout.write('client: RECV {}'.format(client.recv(100))) + time.sleep(0.5)