public SwarmClient(Uri addr, string pipeName = null) { _coordinator = new CommunicationCoordinator(CommunicationMethod.Tcp, addr, pipeName); _coordinator.DebugMessage += msg => DebugMessage?.Invoke(msg); _coordinator.ClientDevice.MessageReceived += HandleMessageReceived; _coordinator.ClientDevice.ResponseReceived += HandleResponseReceived; _coordinator.ClientsUpdated += UpdatedClients; }
/// <summary> /// Stop communicating and destroy all resources. /// </summary> public void Shutdown() { _coordinator?.Shutdown(); _coordinator = null; }