diff --git a/src/MTConnect.NET-Applications-Agents/MTConnectHttpAgentGatewayApplication.cs b/src/MTConnect.NET-Applications-Agents/MTConnectHttpAgentGatewayApplication.cs index 1b73196e..c2b0f50e 100644 --- a/src/MTConnect.NET-Applications-Agents/MTConnectHttpAgentGatewayApplication.cs +++ b/src/MTConnect.NET-Applications-Agents/MTConnectHttpAgentGatewayApplication.cs @@ -102,11 +102,15 @@ protected override void OnStartAgentBeforeLoad(IEnumerable agentClient.OnClientStopped += (s, e) => AgentClientStopped(agentClient); agentClient.OnStreamStarted += (s, query) => AgentClientStreamStarted(agentClient, query); agentClient.OnStreamStopped += (s, e) => AgentClientStreamStopped(agentClient); - agentClient.OnProbeReceived += (s, doc) => DevicesDocumentReceived(agentClient, doc); agentClient.OnCurrentReceived += (s, doc) => StreamsDocumentReceived(agentClient, doc); agentClient.OnSampleReceived += (s, doc) => StreamsDocumentReceived(agentClient, doc); agentClient.OnAssetsReceived += (s, doc) => AssetsDocumentReceived(agentClient, doc); + if (Agent.GetDevice(agentClient.Device) == null) + { + agentClient.OnProbeReceived += (s, doc) => DevicesDocumentReceived(agentClient, doc); + } + _clients.Add(agentClient); } }