ecs-732; Fixed reconnect on initial connection; changed debug levels to 1

This commit is contained in:
Heath Volmer
2018-06-05 10:25:27 -06:00
parent 88a35b0e40
commit e829ba74d5
5 changed files with 7 additions and 7 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -217,7 +217,7 @@ namespace PepperDash.Core
//{
if (Client != null)
{
Debug.Console(2, this, "Cleaning up disconnected client");
Debug.Console(1, this, "Cleaning up disconnected client");
Client.ErrorOccurred -= Client_ErrorOccurred;
KillStream();
@@ -229,7 +229,7 @@ namespace PepperDash.Core
//TheStream = null;
}
Debug.Console(2, this, "Creating new SshClient");
Debug.Console(1, this, "Creating new SshClient");
ConnectionInfo connectionInfo = new ConnectionInfo(Hostname, Port, Username, pauth, kauth);
Client = new SshClient(connectionInfo);
Client.ErrorOccurred += Client_ErrorOccurred;

View File

@@ -234,9 +234,8 @@ namespace PepperDash.Core
Client = new TCPClient(Hostname, Port, BufferSize);
Client.SocketStatusChange += Client_SocketStatusChange;
}
Client.ConnectToServerAsync(null);
DisconnectCalledByUser = false;
Client.ConnectToServerAsync(ConnectToServerCallback); // (null);
}
public void Disconnect()
@@ -258,6 +257,7 @@ namespace PepperDash.Core
void ConnectToServerCallback(TCPClient c)
{
Debug.Console(1, this, "Server connection result: {0}", c.ClientStatus);
if (c.ClientStatus != SocketStatus.SOCKET_STATUS_CONNECTED)
WaitAndTryReconnect();
}
@@ -266,7 +266,7 @@ namespace PepperDash.Core
{
DisconnectClient();
Debug.Console(2, "Attempting reconnect, status={0}", Client.ClientStatus);
Debug.Console(1, "Attempting reconnect, status={0}", Client.ClientStatus);
if(!DisconnectCalledByUser)
RetryTimer = new CTimer(o => { Client.ConnectToServerAsync(ConnectToServerCallback); }, AutoReconnectIntervalMs);
}
@@ -326,7 +326,7 @@ namespace PepperDash.Core
void Client_SocketStatusChange(TCPClient client, SocketStatus clientSocketStatus)
{
Debug.Console(2, this, "Socket status change {0} ({1})", clientSocketStatus, ClientStatusText);
Debug.Console(1, this, "Socket status change {0} ({1})", clientSocketStatus, ClientStatusText);
if (client.ClientStatus != SocketStatus.SOCKET_STATUS_CONNECTED && !DisconnectCalledByUser && AutoReconnect)
WaitAndTryReconnect();

View File

@@ -4,4 +4,4 @@
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Pepperdash_Core")]
[assembly: AssemblyCopyright("Copyright © PepperDash 2016")]
[assembly: AssemblyVersion("1.0.6.*")]
[assembly: AssemblyVersion("1.0.7.*")]