Showing the changes to Source/Libraries/GSF.ServiceProcess/ClientHelper.cs (1 of 6 files). Show all
Unified · Split
| @@ -487,10 +487,6 @@ namespace GSF.ServiceProcess · 486 unmodified lines | ||
| 487 | 487 | if ((object)m_remotingClient == null) |
| 488 | 488 | throw new InvalidOperationException("RemotingClient property of ClientHelper component is not set"); |
| 489 | 489 | |
| 490 | − // Nothing to do if remoting client is already connected | |
| 491 | − if (m_remotingClient.Enabled) | |
| 492 | − return; | |
| 493 | − | |
| 494 | 490 | m_authenticationComplete = false; |
| 495 | 491 | |
| 496 | 492 | // Wait for connection. |
| @@ -500,6 +496,10 @@ namespace GSF.ServiceProcess · 3 unmodified lines | ||
| 500 | 496 | { |
| 501 | 497 | // Wait for authentication. |
| 502 | 498 | Thread.Sleep(100); |
| 499 | + | |
| 500 | + // If remoting client has been disposed (and set to null) while sleeping, go ahead and exit... | |
| 501 | + if ((object)m_remotingClient == null) | |
| 502 | + return; | |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | if (m_remotingClient.Enabled) |
| @@ -718,17 +718,7 @@ namespace GSF.ServiceProcess · 212 unmodified lines | ||
| 718 | 718 | |
| 719 | 719 | // Attempt reconnection on a separate thread. |
| 720 | 720 | if (m_attemptReconnection) |
| 721 | − { | |
| 722 | − new Thread(state => | |
| 723 | − { | |
| 724 | − // Wait at least one second between reconnect attempts... | |
| 725 | − if (Common.IsPosixEnvironment) | |
| 726 | − Thread.Sleep(1000); | |
| 727 | − | |
| 728 | − Connect(); | |
| 729 | − | |
| 730 | − }).Start(); | |
| 731 | − } | |
| 721 | + new Thread(Connect).Start(); | |
| 732 | 722 | } |
| 733 | 723 | |
| 734 | 724 | private void RemotingClient_ReceiveDataComplete(object sender, EventArgs<byte[], int> e) |