On 2/3/11 3:02 PM, Dwayne Blind wrote: > Thanks Stephen. It's really nice of you. > > I have not understood everything though. (I have never used a context > manager before.) > > Here are some comments : > > timeout = s.gettimeout() # Is that the default timeout ? > s.settimeout(3) # I guess this is a 3 second timeout > s.recv(1024) > s.settimeout(timeout) # You change it back ?
Yes. > So with a while loop, it should be : I don't understand why you're doing this while loop business. Your original question is asking for how to NOT do that, I thought. How to use a timeout instead. I showed you how to use a timeout instead-- now you're mixing it in with what you originally had? Why? -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/
signature.asc
Description: OpenPGP digital signature
-- http://mail.python.org/mailman/listinfo/python-list