public void StartDevicePublisher(Configuration.DlnaOptions options) { if (!options.BlastAliveMessages) { return; } if (_publisher != null) { return; } try { _publisher = new SsdpDevicePublisher( _communicationsServer, MediaBrowser.Common.System.OperatingSystem.Name, Environment.OSVersion.VersionString, _config.GetDlnaConfiguration().SendOnlyMatchedHost) { LogFunction = (msg) => _logger.LogDebug("{Msg}", msg), SupportPnpRootDevice = false }; RegisterServerEndpoints(); _publisher.StartBroadcastingAliveMessages(TimeSpan.FromSeconds(options.BlastAliveMessageIntervalSeconds)); } catch (Exception ex) { _logger.LogError(ex, "Error registering endpoint"); } }
public async Task StartDevicePublisher(Configuration.DlnaOptions options) { if (!options.BlastAliveMessages) { return; } if (_Publisher != null) { return; } try { _Publisher = new SsdpDevicePublisher(_communicationsServer, _networkManager, OperatingSystem.Name, Environment.OSVersion.VersionString, _config.GetDlnaConfiguration().SendOnlyMatchedHost); _Publisher.LogFunction = LogMessage; _Publisher.SupportPnpRootDevice = false; await RegisterServerEndpoints().ConfigureAwait(false); _Publisher.StartBroadcastingAliveMessages(TimeSpan.FromSeconds(options.BlastAliveMessageIntervalSeconds)); } catch (Exception ex) { _logger.LogError(ex, "Error registering endpoint"); } }
public async Task StartDevicePublisher(Configuration.DlnaOptions options) { if (!options.BlastAliveMessages) { return; } if (_Publisher != null) { return; } try { _Publisher = new SsdpDevicePublisher(_communicationsServer, _timerFactory, _environmentInfo.OperatingSystemName, _environmentInfo.OperatingSystemVersion); _Publisher.LogFunction = LogMessage; _Publisher.SupportPnpRootDevice = false; await RegisterServerEndpoints().ConfigureAwait(false); _Publisher.StartBroadcastingAliveMessages(TimeSpan.FromSeconds(options.BlastAliveMessageIntervalSeconds)); } catch (Exception ex) { _logger.ErrorException("Error registering endpoint", ex); } }