summaryrefslogtreecommitdiffstats
path: root/sockettest.py
diff options
context:
space:
mode:
Diffstat (limited to 'sockettest.py')
-rw-r--r--sockettest.py24
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()