S
Sumit Acharya
I am using following script to connect to the server and i try the
connection for 1000 times. Some times it succeeds for all the 1000
times,but some times it fails with error:-
10060, 'Operation timed out'. When it fails with the abover error, it
seems timed out time is 20 seconds. Is there a way I can increase the
timedout time for FTP?
from ftplib import FTP
import time
import sys
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)
when there is error in connecting, it comes to the outer except and
prints the value of r-y as 21. How i can increase this timeout time? or
this error indicates something else?
Please let me know asap,
connection for 1000 times. Some times it succeeds for all the 1000
times,but some times it fails with error:-
10060, 'Operation timed out'. When it fails with the abover error, it
seems timed out time is 20 seconds. Is there a way I can increase the
timedout time for FTP?
from ftplib import FTP
import time
import sys
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)
when there is error in connecting, it comes to the outer except and
prints the value of r-y as 21. How i can increase this timeout time? or
this error indicates something else?
Please let me know asap,