Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
9.7k views
in .NET FTP by (280 points)
I am having an issue using dtFTPnetPro connecting to a FTPS site using FTPS Explicit and Passive mode. When I use an external client ( Core Ftp ), it connects and runs just fine, but it takes about 45 seconds to connect. I can't change this since this is a clients FTP server that I have no access on.

I can do the initial connect and handshake just fine, but when I try to open the data connection to do a file list, it times out after 20 or so seconds, regardless of what the Timeout property is set to. Is there something I'm missing, or does the timeout property just not work?

Here is an example log file of what is happening. As you can see, even though timeout is set to 60000, it starts to connect for data transfer at 15:36:04.069, and throws a timeout at 15:36:25.067, which is only 20 or so seconds later, not the 60 specified in timeout.

DEBUG [SFTPMessageStore] 19 Oct 2010 15:35:48.313 : Set timeout=60000
INFO [LicenseProperties] 19 Oct 2010 15:35:48.404 : Licence expiry date: 12/31/9999
INFO [LicenseProperties] 19 Oct 2010 15:35:48.405 : Production license
DEBUG [FTPConnection] 19 Oct 2010 15:35:48.408 : Set LocalDirectory='C:\Personal\Jfarmer\FTPTest\bin\Debug'
DEBUG [SecureFTPConnection] 19 Oct 2010 15:35:48.411 : Set LocalDirectory to C:\Personal\Jfarmer\FTPTest\bin\Debug
INFO [LicenseProperties] 19 Oct 2010 15:35:48.415 : Licence expiry date: 12/31/9999
INFO [LicenseProperties] 19 Oct 2010 15:35:48.415 : Production license
DEBUG [SSLFTPClient] 19 Oct 2010 15:35:48.415 : Connecting to AddressRemovedFromLog:21
DEBUG [SSLFTPControlSocket] 19 Oct 2010 15:35:48.418 : waitOnShutdownSSL=True
DEBUG [HostNameResolver] 19 Oct 2010 15:35:48.450 : Resolving AddressRemovedFromLog
DEBUG [HostNameResolver] 19 Oct 2010 15:35:48.463 : Obtained 1 addresses
DEBUG [HostNameResolver] 19 Oct 2010 15:35:48.463 : IP address: AddressRemovedFromLog
DEBUG [HostNameResolver] 19 Oct 2010 15:35:48.463 : AddressRemovedFromLog resolved to AddressRemovedFromLog
DEBUG [ExFTPControlSocket] 19 Oct 2010 15:35:48.463 : Connecting directly to ftp-server AddressRemovedFromLog:21
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:48.526 : Setting socket timeout=60000
ALL [SecureSocket] 19 Oct 2010 15:35:48.529 : SecureSocket timeout=60000
ALL [SecureSocket] 19 Oct 2010 15:35:48.529 : SecureSocket timeout=60000
INFO [FTPControlSocket] 19 Oct 2010 15:35:48.542 : Command encoding=System.Text.SBCSCodePageEncoding
DEBUG [ExFTPControlSocket] 19 Oct 2010 15:35:48.544 : Created control-socket: SocksContext=, ProxySettings=NoProxy, RemoteHost=AddressRemovedFromLog, controlPort=21, timeout=60000
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:48.550 : StrictReturnCodes=False
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:48.564 : 220-This System Is For Authorized Users Only.
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:48.797 : 220-
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:48.797 : 220 Secure FTP Server - SecureTransport 4.7  ready.
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:48.821 : ---> AUTH TLS
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:48.874 : 234 SSLv23/TLSv1
DEBUG [SSLFTPControlSocket] 19 Oct 2010 15:35:48.878 : Beginning Ssl3, Tls1 handshake.
DEBUG [SocketController] 19 Oct 2010 15:35:58.219 : Processing hello
DEBUG [SecureSocket] 19 Oct 2010 15:35:58.590 : OnHandshakeComplete(True,null)
DEBUG [SSLFTPControlSocket] 19 Oct 2010 15:35:58.591 : Ssl3, Tls1 handshake complete.
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:58.593 : ---> PBSZ 0
ALL [AsyncResult] 19 Oct 2010 15:35:58.605 : Notify setting completed: null 0
ALL [AsyncResult] 19 Oct 2010 15:35:58.605 : Notify setting wait: 0
ALL [TransferBuffer] 19 Oct 2010 15:35:58.632 : Wait begin: TransferBuffer.Read (timeout=60000)
ALL [TransferBuffer] 19 Oct 2010 15:35:58.640 : Wait end: TransferBuffer.Read
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:58.641 : 200 PBSZ=0
ALL [AsyncResult] 19 Oct 2010 15:35:58.642 : Notify setting completed: null 1
ALL [AsyncResult] 19 Oct 2010 15:35:58.642 : Notify setting wait: 1
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:58.643 : ---> PROT P
ALL [AsyncResult] 19 Oct 2010 15:35:58.644 : Notify setting completed: null 2
ALL [AsyncResult] 19 Oct 2010 15:35:58.644 : Notify setting wait: 2
ALL [AsyncResult] 19 Oct 2010 15:35:58.647 : WaitOne completed: 2
ALL [TransferBuffer] 19 Oct 2010 15:35:58.647 : Wait begin: TransferBuffer.Read (timeout=60000)
ALL [AsyncResult] 19 Oct 2010 15:35:58.677 : Notify setting completed: null 3
ALL [TransferBuffer] 19 Oct 2010 15:35:58.677 : Wait end: TransferBuffer.Read
ALL [AsyncResult] 19 Oct 2010 15:35:58.677 : Notify setting wait: 3
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:58.734 : 200 PROT command successful
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:58.742 : ---> USER UsernameRemoved
ALL [AsyncResult] 19 Oct 2010 15:35:58.743 : WaitOne begin: 200 4
ALL [AsyncResult] 19 Oct 2010 15:35:58.743 : Notify setting completed: null 4
ALL [AsyncResult] 19 Oct 2010 15:35:58.743 : Notify setting wait: 4
ALL [AsyncResult] 19 Oct 2010 15:35:58.743 : WaitOne end: True 4
ALL [TransferBuffer] 19 Oct 2010 15:35:58.743 : Wait begin: TransferBuffer.Read (timeout=60000)
ALL [TransferBuffer] 19 Oct 2010 15:35:58.773 : Wait end: TransferBuffer.Read
ALL [AsyncResult] 19 Oct 2010 15:35:58.773 : Notify setting completed: null 5
ALL [AsyncResult] 19 Oct 2010 15:35:58.773 : Notify setting wait: 5
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:58.773 : 331 Password required for UsernameRemoved.
DEBUG [FTPControlSocket] 19 Oct 2010 15:35:58.775 : ---> PASS ********
ALL [AsyncResult] 19 Oct 2010 15:35:58.775 : WaitOne begin: 200 6
ALL [AsyncResult] 19 Oct 2010 15:35:58.775 : Notify setting completed: null 6
ALL [AsyncResult] 19 Oct 2010 15:35:58.775 : Notify setting wait: 6
ALL [AsyncResult] 19 Oct 2010 15:35:58.775 : WaitOne end: True 6
ALL [TransferBuffer] 19 Oct 2010 15:35:58.776 : Wait begin: TransferBuffer.Read (timeout=60000)
ALL [AsyncResult] 19 Oct 2010 15:36:01.370 : Notify setting completed: null 7
ALL [AsyncResult] 19 Oct 2010 15:36:01.371 : Notify setting wait: 7
ALL [TransferBuffer] 19 Oct 2010 15:36:01.371 : Wait end: TransferBuffer.Read
DEBUG [FTPControlSocket] 19 Oct 2010 15:36:01.371 : 230 Virtual user UsernameRemoved logged in.
DEBUG [FTPConnection] 19 Oct 2010 15:36:01.371 : Successfully logged in
DEBUG [ExFTPConnection] 19 Oct 2010 15:36:01.384 : Starting KeepAlive thread with period 30s
DEBUG [FTPControlSocket] 19 Oct 2010 15:36:01.399 : ---> FEAT
ALL [AsyncResult] 19 Oct 2010 15:36:01.399 : WaitOne begin: 200 8
ALL [AsyncResult] 19 Oct 2010 15:36:01.399 : Notify setting completed: null 8
ALL [AsyncResult] 19 Oct 2010 15:36:01.399 : Notify setting wait: 8
ALL [AsyncResult] 19 Oct 2010 15:36:01.399 : WaitOne end: True 8
ALL [TransferBuffer] 19 Oct 2010 15:36:01.399 : Wait begin: TransferBuffer.Read (timeout=60000)
ALL [AsyncResult] 19 Oct 2010 15:36:01.431 : Notify setting completed: null 9
ALL [AsyncResult] 19 Oct 2010 15:36:01.431 : Notify setting wait: 9
ALL [TransferBuffer] 19 Oct 2010 15:36:01.431 : Wait end: TransferBuffer.Read
DEBUG [FTPControlSocket] 19 Oct 2010 15:36:01.431 : 211-Extensions supported
DEBUG [FTPControlSocket] 19 Oct 2010 15:36:01.431 :  AUTH
DEBUG [FTPControlSocket] 19 Oct 2010 15:36:01.431 :  USER
DEBUG [

14 Answers

0 votes
by (161k points)
What version are you using?
0 votes
by (280 points)
I'm not entirely sure, as this product was bought by a coworker of mine that no longer works at our company. If I look at the edtFTPnetPRO.dll, it lists 6.5.0.20 as the product version, if that is what you are looking for. However, I have also tried downloading the latest trial from your website, opening the installer in 7zip and just copying the edtFTPnetPRO.dll out and using that one instead in my project, which shows a production version of 7.2.0.20, and the same behavior is ocurring.
0 votes
by (161k points)
Ok we'll check this out and get back to you.
0 votes
by (161k points)
I've had a look at this.

The problem is that the .NET Socket class doesn't permit you to specify a timeout when connecting. So the timeout value actually applies to all reads and writes on the socket - not for connecting to the host.

There is a workaround but it isn't a quick fix.
0 votes
by (280 points)
What kind of workaround? Even if it isn't a quick fix, it is something we will need to implement, because we have to do sftp file exchanges with this client, and we can't speed up their FTP servers.
0 votes
by (161k points)
It's a workaround that we need to implement to allow a timeout on connecting.

We've been meaning to do it for a while but it hasn't been an issue until now.
0 votes
by (280 points)
Do you have any idea how long this fix would take? We have need of this solution now, but I'm not sure if we should start looking for another workaround in the meantine if it will take a long time for this to be fixed.
0 votes
by (161k points)
I think we could get this done within a week or so. Would that timeframe work for you?
0 votes
by (280 points)
That should be fine. We'll just manually send the files for now until this can be fixed.
0 votes
by (161k points)
Hi, we've now got a build available that uses the set timeout in connect. Please email support at enterprisedt dot com to request the build.

I've tested it for short timeouts, but it isn't so easy to test for long timeouts - I don't have a machine to connect that will take 30 sec for a client to connect to it.

Categories

...