/// <summary> /// Adds the network connector. /// </summary> /// <param name="connector">The connector.</param> public void AddNetworkConnector(INetworkConnector connector) { connectors.Add(connector); if (networkSystemRun) { connector.Start(); } }
/// <inheritdoc cref="IRegistryService.StartupAsync(CancellationToken)"/> public async Task StartupAsync(CancellationToken cancellationToken) { // Link cancellation tokens. CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(5)); using CancellationTokenSource cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, cancellationTokenSource.Token); await _networkConnector.ConnectAsync(cancellationToken); _networkConnector.Start(); }