public void Dispose() { this.Stop(); if (this.aggregationPoller != null) { this.aggregationPoller.Dispose(); this.aggregationPoller = null; } if (this.server != null) { this.server.Dispose(); this.server = null; } if (this.registrationClient != null) { this.registrationClient.Dispose(); this.registrationClient = null; } foreach (var handler in this.requestHandlers.Values) { if (handler.taskRunner != this.taskRunner) { handler.taskRunner.Dispose(); handler.taskRunner = null; } } if (this.ServerList != null) { this.ServerList.Dispose(); this.ServerList = null; } if (this.taskRunner != null) { this.taskRunner.Dispose(); this.taskRunner = null; } }
public void SetRegistrationDestination(string destinationHostname, ushort destinationPort, TimeSpan interval) { if (this.DataManager == null) { throw new InvalidOperationException("Cannot enable registration without data."); } if (this.registrationClient != null) { this.registrationClient.Dispose(); } this.registrationClient = new RegistrationClient(destinationHostname, destinationPort, this.Hostname, this.Port, this.MachineFunction, this.Datacenter, interval, this.DataManager); if (this.server.Running) { this.registrationClient.Start(); } }
public void SetRegistrationDestination(string destinationHostname, ushort destinationPort, TimeSpan interval) { if (this.DataManager == null) { throw new InvalidOperationException("Cannot enable registration without data."); } if (this.registrationClient != null) { this.registrationClient.Dispose(); } this.registrationClient = new RegistrationClient(destinationHostname, destinationPort, this.Hostname, this.Port, this.MachineFunction, this.Datacenter, interval, this.DataManager); if (this.server.Running) { this.registrationClient.Start(); } }
public void Dispose() { this.Stop(); if (this.aggregationPoller != null) { this.aggregationPoller.Dispose(); this.aggregationPoller = null; } if (this.server != null) { this.server.Dispose(); this.server = null; } if (this.registrationClient != null) { this.registrationClient.Dispose(); this.registrationClient = null; } foreach (var handler in this.requestHandlers.Values) { if (handler.taskRunner != this.taskRunner) { handler.taskRunner.Dispose(); handler.taskRunner = null; } } if (this.ServerList != null) { this.ServerList.Dispose(); this.ServerList = null; } if (this.taskRunner != null) { this.taskRunner.Dispose(); this.taskRunner = null; } }