diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-05-29 00:16:22 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-05-29 00:16:22 +0200 |
commit | 5f1c75fd93af98a5d870424971f0383ac4614058 (patch) | |
tree | d0e3d5d00295cdd5c9f65a755254aced21a6ff68 /sockettest.py | |
parent | premium and free download works with rapidshare (diff) | |
download | pyload-5f1c75fd93af98a5d870424971f0383ac4614058.tar.xz |
socket server basic
Diffstat (limited to 'sockettest.py')
-rw-r--r-- | sockettest.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sockettest.py b/sockettest.py new file mode 100644 index 000000000..afac02bb9 --- /dev/null +++ b/sockettest.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python +# -'- coding: utf-8 -*. +""" +authored by: Captain Blackbeard + +script only for socket testing + +""" + +import socket + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.connect(('localhost', 7272)) +print "Connected to server" +data = """A few lines of data to test the operation of both server and client. +Und noch eine Zeile""" +for line in data.splitlines(): + sock.sendall(line+'\n') + print "Sent:", line + +response = sock.recv(8192) + +print "Received:", response +sock.close() |