diff options
| author | Roy <Roy.mail.net@gmail.com> | 2023-01-31 09:44:07 +0200 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2023-01-31 09:44:07 +0200 |
| commit | 42113e1cbf8dbee3ed89992354746abfb49db7d2 (patch) | |
| tree | bc5d23a6ad938cadaa712ae366a83fda8536c6ba /Software/Visual_Studio/Tango.Integration | |
| parent | dbbed260e777d217cc3e897ae31483af183aaabc (diff) | |
| download | Tango-42113e1cbf8dbee3ed89992354746abfb49db7d2.tar.gz Tango-42113e1cbf8dbee3ed89992354746abfb49db7d2.zip | |
Discovery Ttl.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration')
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs index 6a20b558e..da55a13d3 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs @@ -162,6 +162,19 @@ namespace Tango.Integration.ExternalBridge if (IsStarted) { IsStarted = false; + + try + { + _usbDiscoveryThread.Abort(); + _tcpDiscoveryThread.Abort(); + _signalRDiscoveryThread.Abort(); + AvailableMachines.Clear(); + } + catch (Exception ex) + { + Debug.WriteLine(ex); + } + LogManager.Log("External bridge scanner stopped."); } } @@ -213,7 +226,6 @@ namespace Tango.Integration.ExternalBridge { udpClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); udpClient.Client.Bind(new IPEndPoint(IPAddress.Any, _settings.ExternalBridgeServiceDiscoveryPort)); - udpClient.Ttl = 10; udpClient.JoinMulticastGroup(IPAddress.Parse(_settings.ExternalBridgeMulticastGroup), IPAddress.Parse(IPAddressHelper.GetLocalIpAddress())); var endPoint = new IPEndPoint(IPAddress.Any, 0); @@ -297,6 +309,8 @@ namespace Tango.Integration.ExternalBridge { LogManager.Log(ex); } + + Thread.Sleep(100); } } |
