Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Commented Unassigned: An established connection was aborted by the server [2398]

$
0
0
When trying to download files from sftp, I am getting error:"__An established connection was aborted by the server__"
Comments: ** Comment from web user: drs2100 **

I am having this same issue. I am running an SFTP like I did with the previous package. The newest 2014.4.6 has an issue with aborting the connection on sftpClient.DownloadFile.

```
var client = new SftpClient(ip, port, username, password);
client.Connect();
var memoryStream = new MemoryStream();
client.DownloadFile(file.FullName, memoryStream); //This is the offending line
var zipFile = new ZipArchive(memoryStream);
```

Using dotPeek to decompile the dll it looks like the below is the offending line

```
private void InternalUploadFile(Stream input, string path, Renci.SshNet.Sftp.Flags flags, SftpUploadAsyncResult asyncResult, Action<ulong> uploadCallback)
{
...
if (this._sftpSession == null)
throw new SshConnectionException("Client not connected.");
....
}
```

The _sftpSession is private so I cannot start session manually to handle this like below

```
protected override void OnConnected()
{
base.OnConnected();
this._sftpSession = new SftpSession(this.Session, this.OperationTimeout, this.ConnectionInfo.Encoding);
this._sftpSession.Connect();
}
```

Please help. Thank you.


Viewing all articles
Browse latest Browse all 1026

Trending Articles



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