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

Commented Unassigned: SendKeepAlive fails: An established connection was aborted by the software in your host machine [2029]

$
0
0
Seems like library does not handle Socket Exceptions gracefully in all cases.
If I set time span value for SendKeepAlive and connection is lost System.Net.Sockets.SocketException exception is thrown. As far as I understand, no exceptions should be thrown but OnError event should be raised?

I'm using version 2013.4.7, but tried with current source with same results.
I've fixed it for myself by wrapping it with try / catch in SendKeepAlive method in Session.cs, so it looks like this now

```
internal void SendKeepAlive()
{
try
{
this.SendMessage(new IgnoreMessage());
}
catch (Exception exp)
{
this.RaiseError(exp);
}
}
```

Thank you for your work, regards.


```
Exception: An established connection was aborted by the software in your host machine
ErrorCode: 10053
at Renci.SshNet.Session.SocketWrite(Byte[] data)
at Renci.SshNet.Session.SendMessage(Message message)
at Renci.SshNet.BaseClient.SendKeepAlive()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.TimerQueueTimer.CallCallback()
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.TimerQueue.FireNextTimers()
```
Comments: ** Comment from web user: shax **

I can't really tell you. We've deployed our solution based on SSH.net library that opens remote tunnels to our server. It' currently installed on around 500 machines and all bug reports / crashes are sent to Mantis Bug Tracker via NBug. I usually get maybe 10-20 of crash exceptions like this on bug tracker per day, but can't really remember how I managed to reproduce it locally.

I know in the end I simply created throw statement in SendKeepAlive method to throw SocketException with error code 10053 but only if SendKeepAlive was called from Timer thread, not directly. That way I was able to open connection, set keepalive time span, send keep alive directly, wait for few minutes untill timer fires and exception is thrown from timer thread and there is no way for me to handle it.

Hope it's a bit more clear now?


Viewing all articles
Browse latest Browse all 1026

Trending Articles



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