mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-04-12 20:16:34 +00:00
fix: handle Renci timeout exception
This commit is contained in:
parent
5908e67055
commit
a60a277e49
1 changed files with 21 additions and 4 deletions
|
|
@ -269,13 +269,18 @@ namespace PepperDash.Core
|
|||
var errorLogLevel = DisconnectLogged == true ? Debug.ErrorLogLevel.None : Debug.ErrorLogLevel.Error;
|
||||
|
||||
if (ie is SocketException)
|
||||
this.LogException(ie, "'{0}' CONNECTION failure: Cannot reach host, ({1})", Key, ie.Message);
|
||||
else if (ie is System.Net.Sockets.SocketException)
|
||||
{
|
||||
this.LogException(ie, "CONNECTION failure: Cannot reach host, ({1})", Key, ie.Message);
|
||||
}
|
||||
|
||||
if (ie is System.Net.Sockets.SocketException socketException)
|
||||
{
|
||||
this.LogException(ie, "'{0}' Connection failure: Cannot reach host '{1}' on port {2}, ({3})",
|
||||
Key, Hostname, Port, ie.GetType());
|
||||
else if (ie is SshAuthenticationException)
|
||||
}
|
||||
if (ie is SshAuthenticationException)
|
||||
{
|
||||
this.LogException(ie, "Authentication failure for username '{0}', ({1})",this,
|
||||
this.LogException(ie, "Authentication failure for username '{0}', ({1})", this,
|
||||
Username, ie.Message);
|
||||
}
|
||||
else
|
||||
|
|
@ -289,6 +294,18 @@ namespace PepperDash.Core
|
|||
ReconnectTimer.Reset(AutoReconnectIntervalMs);
|
||||
}
|
||||
}
|
||||
catch(SshOperationTimeoutException ex)
|
||||
{
|
||||
this.LogWarning("Connection attempt timed out: {message}", ex.Message);
|
||||
|
||||
DisconnectLogged = true;
|
||||
KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED);
|
||||
if (AutoReconnect)
|
||||
{
|
||||
this.LogDebug("Checking autoreconnect: {0}, {1}ms", AutoReconnect, AutoReconnectIntervalMs);
|
||||
ReconnectTimer.Reset(AutoReconnectIntervalMs);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
var errorLogLevel = DisconnectLogged == true ? Debug.ErrorLogLevel.None : Debug.ErrorLogLevel.Error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue