我在Delphi XE2中使用TIdFTP(Indy 10.2); 方法'connect'(创建连接......)非常慢; 完成任务需要7到8秒。 我尝试过不同的配置:被动真或假,AutoLogin真或假,但或多或少相同的情况。 是否有任何特殊配置需要考虑?
I'm using TIdFTP (Indy 10.2) in Delphi XE2; the method 'connect' (to create a connection...) is very slow; it takes 7 - 8 seconds to accomplish task. I have tried with different configurations: Passive true or false, AutoLogin true or false, but more or less the same situation. Is there any particular configuration to consider ?
最满意答案
首先,10.2是一个非常老和过时的版本。 目前的版本是10.6。 你应该认真考虑升级。
其次, Connect()做了很多工作。 它总是至少发送一个SYST命令,但是根据以下属性的值,它可能还会发送许多其他命令:
UseHOST =真 HOST 自动登录=真 AUTH 1-4 times (only if UseTLS is utUseRequireTLS or utUseExplicitTLS) XAUT (only if ProxySettings.ProxyType is fpcmNone) USER PASS ACCT OPEN (only if ProxySettings.ProxyType is fpcmOpen) EPSV ALL (only if EPSV is supported) SITE ZONE (only if SITE ZONE is supported) TYPE AutoIssueFEAT =真 FEAT CLNT所以花7-8秒完成并不是不合理的,这取决于它必须发送多少命令以及你可用的带宽。 要使Connect()尽快返回,请关闭所有自动功能,然后在准备好时手动调用Login()和IssueFEAT() 。
First, 10.2 is a VERY OLD and OUTDATED version. The current version is 10.6. You should seriously consider upgrading.
Second, Connect() does a lot of work. It always sends a SYST command at a minimum, but depending on the values of the following properties, it may send a lot of additional commands as well:
UseHOST=True HOST AutoLogin=True AUTH 1-4 times (only if UseTLS is utUseRequireTLS or utUseExplicitTLS) XAUT (only if ProxySettings.ProxyType is fpcmNone) USER PASS ACCT OPEN (only if ProxySettings.ProxyType is fpcmOpen) EPSV ALL (only if EPSV is supported) SITE ZONE (only if SITE ZONE is supported) TYPE AutoIssueFEAT=True FEAT CLNTSo taking 7-8 seconds to complete is not unreasonable depending on how many commands it has to send and how much bandwidth you have available. To make Connect() return as soon as possible, turn off all of the auto features, and then call Login() and IssueFEAT() manually when ready.
更多推荐
发布评论