Client/Server based on SocketServer and Windows

Kiki julien.chevalier at
Sun Aug 9 18:22:40 CEST 2009

Hello list,

I've written a small Client/server system.
Basically, i'm expecting something like : The client sends every once
and a while a small data chunk (not more than 50 bytes) the server
receive it and print it.

Here is the server request handler :

class ThreadedTCPRequestHandlerFoo(SocketServer.BaseRequestHandler):

    def handle(self):
	    data = self.request.recv(1024)
	    cur_thread = threading.currentThread()
            response = "%s: %s from Foo" % (cur_thread.getName(),
            print response

and this is the client :

def clientPrompt(ip, port, message):
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.connect((ip, port))
		print "%s\n" % k
		if k == 'quit': break

My problem comes from that I can't send data from client more than
once without having the following Winsock error : 10053 Software
caused connection abort.
I have to restart the client each time I want to send a new message.

Could anyboy explain me why ?


More information about the Python-list mailing list