Exemplo n.º 1
0
        private Task BroadcastDiscoverMessage(string serviceType, TimeSpan mxValue)
        {
            var values = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);

            values["HOST"]       = "239.255.255.250:1900";
            values["USER-AGENT"] = "UPnP/1.0 DLNADOC/1.50 Platinum/1.0.4.2";
            //values["X-EMBY-SERVERID"] = _appHost.SystemId;

            values["MAN"] = "\"ssdp:discover\"";

            // Search target
            values["ST"] = "ssdp:all";

            // Seconds to delay response
            values["MX"] = "3";

            var header = "M-SEARCH * HTTP/1.1";

            var message = SsdpHelper.BuildMessage(header, values);

            return(_CommunicationsServer.SendMulticastMessage(message));
        }
Exemplo n.º 2
0
        private void BroadcastDiscoverMessage(string serviceType, TimeSpan mxValue)
        {
            var broadcastMessage = BuildDiscoverMessage(serviceType, mxValue);

            _CommunicationsServer.SendMulticastMessage(broadcastMessage);
        }