diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-03-26 08:41:04 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-03-26 08:41:04 +0200 |
| commit | 7594cea7dc1b3fef5be77fa06c71a954d024723d (patch) | |
| tree | e70e25ef61e938b8c20c1bcdbad164441a3b8542 /Software/Visual_Studio/Tango.Integration | |
| parent | d6a9f6a9ca9346bdf048c62d810667852bb80d1c (diff) | |
| download | Tango-7594cea7dc1b3fef5be77fa06c71a954d024723d.tar.gz Tango-7594cea7dc1b3fef5be77fa06c71a954d024723d.zip | |
Added support for public IP address on SignalR connection.
Fixed issue with ExternalBridgeScanner.
Added Connection Time.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration')
3 files changed, 18 insertions, 11 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs index 21767174f..160555550 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs @@ -135,7 +135,7 @@ namespace Tango.Integration.ExternalBridge bool signalRStarted = false; - _connection.StateChanged += (x) => + _connection.StateChanged += (x) => { if (x.NewState == ConnectionState.Connected) { @@ -298,11 +298,11 @@ namespace Tango.Integration.ExternalBridge if (knownMachine == null) { - newMachine = new ExternalBridgeSignalRClient(SignalRConfiguration.Address, SignalRConfiguration.Hub, machine.SerialNumber); + newMachine = new ExternalBridgeSignalRClient(SignalRConfiguration.Address, SignalRConfiguration.Hub, machine); } else { - newMachine = new ExternalBridgeSignalRClient(SignalRConfiguration.Address, SignalRConfiguration.Hub, knownMachine); + newMachine = new ExternalBridgeSignalRClient(SignalRConfiguration.Address, SignalRConfiguration.Hub, knownMachine,machine); } ThreadsHelper.InvokeUINow(() => diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeSignalRClient.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeSignalRClient.cs index 1596d2c9b..343fb302f 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeSignalRClient.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeSignalRClient.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using Tango.BL; using Tango.BL.Entities; +using Tango.Integration.ExternalBridge.Web; using Tango.Integration.Operation; using Tango.PMR.Integration; using Tango.Settings; @@ -16,28 +17,28 @@ namespace Tango.Integration.ExternalBridge { public class ExternalBridgeSignalRClient : ExternalBridgeTcpClient { - public ExternalBridgeSignalRClient(String url, String hub, String serialNumber) + public ExternalBridgeSignalRClient(String url, String hub, MachineInfo machineInfo) { ComponentName = $"External Bridge SignalR Client {_component_counter++}"; - SerialNumber = serialNumber; - IPAddress = hub; - Machine = ObservablesStaticCollections.Instance.Machines.SingleOrDefault(x => x.SerialNumber == serialNumber); - Adapter = new SignalRTransportAdapter(url, hub, SignalRTransportAdapterMode.CreateSession, serialNumber); + SerialNumber = machineInfo.SerialNumber; + IPAddress = machineInfo.IPAddress; + Machine = ObservablesStaticCollections.Instance.Machines.SingleOrDefault(x => x.SerialNumber == SerialNumber); + Adapter = new SignalRTransportAdapter(url, hub, SignalRTransportAdapterMode.CreateSession, SerialNumber, null, IPAddress); KeepAliveTimeout = TimeSpan.FromSeconds(5); KeepAliveRetries = 2; UseKeepAlive = false; } - public ExternalBridgeSignalRClient(String url, String hub, Machine machine) + public ExternalBridgeSignalRClient(String url, String hub, Machine machine, MachineInfo machineInfo) { ComponentName = $"External Bridge SignalR Client {_component_counter++}"; SerialNumber = machine.SerialNumber; - IPAddress = hub; + IPAddress = machineInfo.IPAddress; Machine = machine; - Adapter = new SignalRTransportAdapter(url, hub, SignalRTransportAdapterMode.CreateSession, SerialNumber); + Adapter = new SignalRTransportAdapter(url, hub, SignalRTransportAdapterMode.CreateSession, SerialNumber, null, IPAddress); KeepAliveTimeout = TimeSpan.FromSeconds(5); KeepAliveRetries = 2; diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Web/MachineInfo.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/Web/MachineInfo.cs index a7e3f90ca..a33d073d1 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Web/MachineInfo.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/Web/MachineInfo.cs @@ -10,5 +10,11 @@ namespace Tango.Integration.ExternalBridge.Web { public String SerialNumber { get; set; } public String Organization { get; set; } + public String IPAddress { get; set; } + + public MachineInfo() + { + IPAddress = "Unknown"; + } } } |
