Delphi XE2中的TIdFtp

编程入门 行业动态 更新时间:2024-10-27 03:38:53
Delphi XE2中的TIdFtp - 连接方法非常慢(TIdFtp in Delphi XE2 - connect method very slow)

我在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 CLNT

So 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.

更多推荐

本文发布于:2023-08-05 14:09:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1434104.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Delphi   TIdFtp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!