@@ -0,0 +1,623 @@
+#!/usr/bin/env python%0A%0A# ex_simple_server.py by mariuszha%0A#%0A# Purpose:%0A# Create a simple Echo Server to handle 1 client %0A#%0A%0Aimport socket%0A%0AtcpSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)%0AtcpSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)%0A%0Abind_IP = '0.0.0.0'%0Abind_port = 4444%0A%0A#tcpSocket.listen(1)%0A%0A%0AtcpSocket.bind((bind_IP, bind_port))%0A%0AtcpSocket.listen(1)%0A%0A%0Aprint 'Waiting for a client ...'%0A%0A(client, (ip, sock)) = tcpSocket.accept()%0A%0Aprint 'Receiving connection from %25s' %25 ip%0A%0Adata = client.recv(2048)%0A%0Aclient.send('Echo ' + data)%0A%0Aprint 'Receiving from the client: %25s' %25 data%0A%0Aclient.close()%0A

Create ex_simple_server.py