newbie question

jeff plastic"no-spam-pls" at xsintrk.net
Thu Apr 15 18:01:14 EDT 2004


Krzysztof Stachlewski <stach at fr.USUN.pl> wrote in
news:c5mvrg$fda$1 at absinth.dialog.net.pl: 

> First of all, you can't be sure that you will receive the text "kill"
> in one piece. It could happen that one recv() call will give only
> "ki" and the following recv() will return the rest of it.
> Moreover - try to print repr(sdata) and see what *exactly* is
> received.

i only want the socket to close if the word 'kill' has been sent.
i just tried 'if sdata == "kill\r\n": s.close()', kill\r\n was the string 
repr(sdata) returned.  the IF statement works, but i'm getting a 'bad file 
descriptor' error on the s.close().



More information about the Python-list mailing list