Timeout issue in .Net but not in UI

Advertisement

mouton
Joined:
Posts:
2

Timeout issue in .Net but not in UI

Hi,

I have a .Net application which automates file download. When I try to connect to a site making an SFTP connection via the .Net app, I get a time out error. When I try to connect to the exact same site via the user interface, I connect fine. I copied the code generated by the Generate Session/URL,and added a few more options but still, the error persists.

Here is the actual code, where _connInfo is the information I am passing in:

sessionOptions.Protocol = Protocol.Sftp;
sessionOptions.SshPrivateKeyPath = _connInfo.SshPrivateKeyPath;
sessionOptions.GiveUpSecurityAndAcceptAnySshHostKey = false;
sessionOptions.SshHostKeyFingerprint = _connInfo.SshHostKeyFingerprint;
sessionOptions.HostName = _connInfo.ServerHostName;
sessionOptions.UserName = _connInfo.ServerUserName;
sessionOptions.Password = _connInfo.ServerPassWord;
sessionOptions.PortNumber = _connInfo.ServerPort;
sessionOptions.AddRawSettings("ProxyPort", "0");

Here is the exact error: "ex.Message = "Network error: Connection to \"xxx.xxx.xxx.xxx\" timed out."

Extending the timeout did not work either.

I am using WinSCP version 5.13.1.0.
Any help would be much appreciated.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,809
Location:
Prague, Czechia

Re: Timeout issue in .Net but not in UI

Please post a complete session log files both from GUI and .NET.

Reply with quote

mouton
Joined:
Posts:
2

Thanks for responding. I figured this out. As it was to be expected, one of the params (port) was not being passed properly. :-(

Reply with quote

Advertisement

You can post new topics in this forum