0 votes
by (220 points)

We are observing few situations where ConnectAsync is taking too long (~30 mins) to connect to server. Though I have set the connection timeout of FileTransferClient's Timeout property, I am not sure it is taking that into consideration.

On going through rebex forum I came to know that it does not apply to async functions.

So will setting FileTransferClient.Settings.TimeoutAsynchronousMethods make this apply to async functions as well?

1) We are not using FTP servers instead we are connecting to sftp servers. Will the same property (FileTransferClient.Settings.TimeoutAsynchronousMethods) add timeout to sftp connections as well?

2) Many of the times we receive Not authenticated to the server. error after LogingAsync when we try to do any data operation (create dir etc). We observed that this error occurs even if the username and password are correct but the sftp server root dir does not exists.
What are the possible conditions in which we get this error so that we can handle the cases accordingly?

Applies to: Rebex FTP/SSL, Rebex SFTP

1 Answer

0 votes
by (147k points)

1) Thanks for bringing this to our attention. The TimeoutAsynchronousMethods property only exists due to a mistake, and it only applies to FTP (where it makes the Timeout property apply to async functions as well). But it has no effect when SFTP is used. We'll address this in one of the next releases. Sorry for the inconvenience!

2) This is most likely related to a bug reported recently that makes the ConnectAsync method finish successfully even when the connection attempt has failed. Subsequently, when LoginAsync is called, it fails with "Not authenticated to the server" because no connection has been established. We will publish the next release that fixes this issue tomorrow.

by (220 points)
Thanks for the reply.

1) Does this mean that FileTransferClient's Timeout property has no effect on connect and it never times out the sftp connection (connect request and transfer request) ? If yes then is there any workaround for this?

2) Does FileTransferClient's IsConnected property is set to false if the connection attempt fails? So that we can use that to check the connection state and then only attempt to login.
by (147k points)
1)  FileTransferClient's Timeout property works as intended and only applies to synchronous methods, including Connect, for both FTP and SFTP. It was not supposed to apply to async methods, just like HttpRequest's Timeout property in .NET Framework does not apply to async methods either.

What does not work properly is the TimeoutAsynchronousMethods setting, which was originally an old FTP-only tweak in Rebex Ftp's Settings, and was later incorporated into FileTranserClient along with the rest of FTP-only properties.

We will resolve this by making TimeoutAsynchronousMethods work for SFTP as well. If you would like to get a hotfix when this is ready, please let me know.

2) Yes, IsConnected property was set to false in those cases.
by (220 points)
Thanks for clarification.

We are using Rebex.FileTransfer version 4.0.6930. Can you please let me know by when we can expect the hotfix for both issues (TimeoutAsynchronousMethods  and ConnectAsync  fails with Not authenticated to the server )?
by (147k points)
I sent a link to a hotfix to your e-mail address. Please give it a try.
...