On Feb 25, 2:43 am, [EMAIL PROTECTED] wrote: > > by reusing the same variables without storing the previous values. > This could make the Python > garbage collector to attempt freeing the socket object created with > the first connection, therefore > closing the connection. > > If I'm right, your program should work as you expect if you for > instance collect in a list the sockets > returned by accept. >
Yes, you are right about that. This code prevents the first client from disconnecting: newsocks = [] client_addys = [] while 1: newsock, client_addr = s.accept() newsocks.append(newsock) client_addys.append(client_addr) print "original socket:", s.getsockname() print "new socket, self:", newsock.getsockname() print "new socket, peer:", newsock.getpeername() print -- http://mail.python.org/mailman/listinfo/python-list