+1 vote
by (160 points)
edited

Hello,

I'm having an issue in a section of code that transmits XML files to 2 mission critial servers and then to a 3rd server where the transmission is optional. So I want the 3rd transmission to timeout rather quickly if there is a problem but the timeout seems to be ignored for a SFTP Connect(). With the following code and using a port that is blocked it does not timeout for 20 - 30 seconds regardless of what I set the Timeout to. Is there something I'm missing?

sftpClient = new Sftp();
sftpClient.Timeout = 5000;
sftpClient.Connect(sftpHost, 22);

Thanks

Applies to: Rebex SFTP

2 Answers

0 votes
by (58.9k points)
edited
 
Best answer

For other visitors - this turned out to be a bug in Rebex SFTP. A trial hotfix can be downloaded from here. A full hotfix is available for registered customers, just write us an email to support@rebex.net.

UPDATE

The bugfix is part of Rebex 2013R3 release. See the blogpost for more information and release notes for complete list of changes in Rebex Sftp 2013R3 version.

by (160 points)
edited

Thanks Tomas, the hotfix is working great. That was fast service!

0 votes
by (58.9k points)
edited

Hello,

actually setting Timeout to 5 seconds does not mean 5 seconds from the start of the method. There is an internal counter for each socket operation. If Rebex component retrieves no response from the server within a specified time limit (5 seconds in your case), then the Timeout is triggered. That does not mean that there might be more sucessful operations before in the Connect method which would result in the Connect method failing after 20-30seconds.

Could you please create a log of the communication with the code below:

var sftpClient = new Sftp();
sftpClient.LogWriter = new FileLogWriter(@"C:\log.txt");
sftpClient.Timeout = 5000;
sftpClient.Connect(sftpHost, 22);

and either post it here or send to support@rebex.net so that we can check on that?

by (160 points)
edited

Thanks, I just emailed the log file.

by (58.9k points)
edited

Thank you for the report and log, we have been able to reproduce this issue by connecting to a non-existing host. I have just created a new case in our bug-tracking system and we will send you a hotfix when it is ready.

...