public void ProcessRequest(UpnpRequest request)
        {
            if (request.Verb != "M-SEARCH")
            {
                return;
            }

            if (request.Uri != "*")
            {
                return;
            }

            bool multiscreenRequest = request
                .Headers["ST"]
                .Any(h => h.Value == "urn:dial-multiscreen-org:service:dial:1");
            if (!multiscreenRequest)
            {
                return;
            }

            if (!multiscreenRequest)
            {
                return;
            }

            Console.WriteLine("multiscreen discovery request");

            request.Reply(
                builder =>
                {
                    builder.SetStatus(200, "OK");
                    builder.AddHeader("LOCATION", m_descriptorLocation );
                    builder.AddHeader("CACHE-CONTROL", "max-age=300");
                    builder.AddHeader("EXT", "");
                    builder.AddHeader("BOOTID.UPNP.ORG", "1");
                    builder.AddHeader("ST", "urn:dial-multiscreen-org:service:dial:1");
                }
            );
        }
 private void ProcessRequest(UpnpRequest request)
 {
     foreach (IUpnpHandler handler in m_handlers)
     {
         handler.ProcessRequest(request);
     }
 }
        public static bool TryParse(
            Action<string> replyFunc,
            IPEndPoint clientEndPoint,
            string message,
            out UpnpRequest request
            )
        {
            request = null;
            string[] lines = message.Split(new string[] { "\r\n" }, StringSplitOptions.None);
            if (lines.Length == 0)
            {
                return false;
            }
            Match requestLine = m_requestLine.Match(lines[0]);
            if (!requestLine.Success)
            {
                return false;
            }

            string verb = requestLine.Groups["verb"].Value.ToUpperInvariant();
            string uri = requestLine.Groups["uri"].Value;
            string httpVersion = requestLine.Groups["version"].Value;

            UpnpHeader[] headers = lines
                .Skip(1)
                .Select(ParseHeaderOrNull)
                .Where(h => h != null).ToArray();

            request = new UpnpRequest(
                replyFunc,
                clientEndPoint,
                verb,
                uri,
                httpVersion,
                headers
            );
            return true;
        }