a h wrote:
hi
thanks for the replies.
setting socket timeout works fine.
I also find alternate way that perform the same thing,ie ftp connection
timeout.

import ftplib
f = ftplib.FTP("server_host_name", "TIMEOUT")


Thanks for posting back. And I learnt something new: that the
FTP initialiser takes a timeout parameter, so thanks for
educating me. I would point out, tho', that your quick
example above obviously *won't* set the timeout; it will
connect to the server with a username of "TIMEOUT". Hopefully
you knew that and were just jotting quickly, but for any
future readers, the timeout is most easily specified as
a named param to the FTP constructor:

f = ftplib.FTP ("mail.python.org", timeout=2.0)

TJG
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to