mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-12 11:14:54 +00:00
ecs-732; Fixed reconnect on initial connection; changed debug levels to 1
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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.*")]
|
||||
|
||||
Reference in New Issue
Block a user