10060, 'Operation timed out'

Steve Holden steve at holdenweb.com
Wed Jan 18 04:22:36 EST 2006


Sumit Acharya wrote:
> can u please modify the script that i have posted with your suggestion,
> it will help me to a certain extent.
> 
> Thanks
> 
from ftplib import FTP
import time
import sys
import socket

socket.setdefaulttimeout(60)
host = sys.argv[1]
port = sys.argv[2]

for x in range(1000):
try:
    y = time.time()
     ftp = FTP()
     ftp.connect(host,port)
     ftp.login('a','a')
     try:
         print ftp.sendcmd('pass x')
     except:
         print sys.exc_value
     ftp.close()
except:
     print sys.exc_value
     r = time.time()
     print "Timeout %d %d %((r-y),x)



-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/




More information about the Python-list mailing list