2015-06-02 21:20:49 +02:00
parent 12b5878f54
commit 219ffcce0f
3 changed files with 95 additions and 0 deletions

13
TcpClient.py Normal file
View File

@@ -0,0 +1,13 @@
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('localhost', 8881))
print "Connected to server"
data = """A few lines of data
to test the operation
of both server and client."""
for line in data.splitlines( ):
sock.sendall(line+'\n')
print "Sent:", line
response = sock.recv(8192)
print "Received:", response
sock.close( )