C#UWP如何订阅UPnP事件

时间:2016-09-19 21:21:38

标签: c# uwp windows-10-universal upnp

我希望你能帮助我。我知道我正在尝试为Windows-10 UWP开发一个漂亮的小MediaController应用程序(对于我的Lumia950和我的PC)。

目前我可以发送SOAP-Messages来检索现有MediaRenderer或MediaServer的信息

=> Code snipped
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, new Uri(control_url));
request.Headers.Add("SOAPACTION", "\""+ service_type + "#" + this.Name + "\"");
request.Method = HttpMethod.Post;
HttpStringContent requestContent = new HttpStringContent(xml.ToString(), Windows.Storage.Streams.UnicodeEncoding.Utf8, "text/xml");
request.Content = requestContent;

HttpResponseMessage response = await client.SendRequestAsync(request);

但我完全失去了如何订阅upnp事件。我在网上搜了几个小时但找不到一些指导。据我所知,我需要用“SUBSCRIBE”作为方法创建一个HttpRequest?!我还需要给tom ipaddress进行回调(如何确定哪个端口是免费的?如果upnpdevice触发了一个事件,如何引起注意?)。但就是这样。

任何帮助和代码示例都会很棒。谢谢。

0 个答案:

没有答案
相关问题