|
|
@ -87,11 +87,12 @@ namespace MediaBrowser.Dlna.Ssdp
|
|
|
|
public event EventHandler<SsdpMessageEventArgs> MessageReceived;
|
|
|
|
public event EventHandler<SsdpMessageEventArgs> MessageReceived;
|
|
|
|
|
|
|
|
|
|
|
|
private async void OnMessageReceived(SsdpMessageEventArgs args)
|
|
|
|
private async void OnMessageReceived(SsdpMessageEventArgs args)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (string.Equals(args.Method, "M-SEARCH", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var headers = args.Headers;
|
|
|
|
var headers = args.Headers;
|
|
|
|
|
|
|
|
string st;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (string.Equals(args.Method, "M-SEARCH", StringComparison.OrdinalIgnoreCase) && headers.TryGetValue("st", out st))
|
|
|
|
|
|
|
|
{
|
|
|
|
TimeSpan delay = GetSearchDelay(headers);
|
|
|
|
TimeSpan delay = GetSearchDelay(headers);
|
|
|
|
|
|
|
|
|
|
|
|
if (_config.GetDlnaConfiguration().EnableDebugLogging)
|
|
|
|
if (_config.GetDlnaConfiguration().EnableDebugLogging)
|
|
|
@ -101,12 +102,8 @@ namespace MediaBrowser.Dlna.Ssdp
|
|
|
|
|
|
|
|
|
|
|
|
await Task.Delay(delay).ConfigureAwait(false);
|
|
|
|
await Task.Delay(delay).ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
|
|
string st;
|
|
|
|
|
|
|
|
if (headers.TryGetValue("st", out st))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
RespondToSearch(args.EndPoint, st);
|
|
|
|
RespondToSearch(args.EndPoint, st);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EventHelper.FireEventIfNotNull(MessageReceived, this, args, _logger);
|
|
|
|
EventHelper.FireEventIfNotNull(MessageReceived, this, args, _logger);
|
|
|
|
}
|
|
|
|
}
|
|
|
|