Hello,
In my code when I use KeepAliveInterval connection loss occurs if the application is finished with a signature of exception "An established connection was aborted by the software on the host computer" on SendKeepAlive.
/// <summary>
/// Sends keep-alive message to the server.
/// </summary>
public void SendKeepAlive()
{
Marcelo
In my code when I use KeepAliveInterval connection loss occurs if the application is finished with a signature of exception "An established connection was aborted by the software on the host computer" on SendKeepAlive.
Me.StatusTextBoxSSH.AppendText("Conexão SSH Estabelecida..." & Chr(13) & Chr(10))
Me.StatusTextBoxSSH.AppendText("Iniciando Tunelamento SSH..." & Chr(13) & Chr(10))
Me.Refresh()
f_intRandonPort = f_rdnRandonLoud.Next(30000, 60000) ' Gera Porta do servidor randômica
f_strTunnelRemotoServer = CStr(f_intRandonPort)
f_sshPortForwardRemote = New SshNet.ForwardedPortRemote(g_clsIni.Loopback, CUInt(f_strTunnelRemotoServer), g_clsIni.Loopback, CUInt(f_strTunnelRemoto))
f_sshTunnel.AddForwardedPort(f_sshPortForwardRemote)
f_sshPortForwardRemote.Start()
f_sshTunnel.SendKeepAlive()
If f_sshPortForwardRemote.IsStarted Then
Me.StatusTextBoxSSH.AppendText("Tunelamento SSH Iniciado" & Chr(13) & Chr(10) & _
"Porta do Tunel " & f_intRandonPort & Chr(13) & Chr(10) & _
"Portal local " & f_strTunnelRemoto & Chr(13) & Chr(10))
Me.Refresh()
Else
Debugging the source code of the library and my code together Renci exception occurs in BaseClient.cs. If the connection is lost with the still active session an error occurs during the execution of SendKeepAlive./// <summary>
/// Sends keep-alive message to the server.
/// </summary>
public void SendKeepAlive()
{
try
{
if (this.Session == null)
return;
if (!this.Session.IsConnected)
return;
this.Session.SendKeepAlive();
}
}Marcelo