Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Renci.SshNet.Common.SshOperationTimeoutException

$
0
0
Hi - I'm getting the error when I attempt to upload a file to our vendor's server. I can upload just fine to our dev server (same code and file).

I've attached the trace file. Any ideas on what's going on? I can provide the vendor site & credentials (privately) if you want to try it.

Code
           using (var sftp = new SftpClient(host, username, password))
            {
                sftp.Connect();
                //sftp.SendKeepAlive(); didn't make a difference

                using (var file = File.OpenRead(@"file.txt"))
                {
                    sftp.UploadFile(file, remoteFileName);
                }

                sftp.Disconnect();
            }
Exxception:
Renci.SshNet.Common.SshOperationTimeoutException was unhandled
HResult=-2146233088
Message=Session operation has timed out
Source=Renci.SshNet
StackTrace:
   at Renci.SshNet.Session.WaitHandle(WaitHandle waitHandle)
   at Renci.SshNet.Channels.Channel.WaitHandle(WaitHandle waitHandle)
   at Renci.SshNet.Channels.Channel.SendMessage(ChannelDataMessage message)
   at Renci.SshNet.Channels.Channel.SendData(Byte[] buffer)
   at Renci.SshNet.Sftp.SubsystemSession.SendData(Byte[] data)
   at Renci.SshNet.Sftp.SftpSession.SendMessage(SftpMessage sftpMessage)
   at Renci.SshNet.Sftp.SftpSession.SendRequest(SftpRequest request)
   at Renci.SshNet.Sftp.SftpSession.RequestWrite(Byte[] handle, UInt64 offset, Byte[] data, EventWaitHandle wait, Action`1 writeCompleted)
   at Renci.SshNet.SftpClient.InternalUploadFile(Stream input, String path, Flags flags, SftpUploadAsyncResult asyncResult, Action`1 uploadCallback)
   at Renci.SshNet.SftpClient.UploadFile(Stream input, String path, Boolean canOverride, Action`1 uploadCallback)

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>