[Tutor] socket send problem

helena bhaska helena_b2001 at yahoo.com
Tue Dec 16 20:18:48 EST 2003


Hi,
I have just started playing with python and sockets,
and here is the code that I wrote:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
                
for x in self.command:
    sent = s.send(x)
    print "amount sent: "+sent
    s.close()

where command is a list of strings. For some reason I
never get to the print statement.  The receiving end
listens for connections, as soon as it gets one, it
creates a thread which deals with the data sent
through, with recv() statement.

Any help/pointers would be greatly appreciated!
Thanks,
Helena



__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/



More information about the Tutor mailing list