Esempio n. 1
0
        /// <summary>The method the thread pool invokes when a thread is available to handle an HTTP request.</summary>
        /// <param name="responder">TcpClient from the socket accept.</param>
        public void WaitCallback(object responder)
        {
            XmlRpcResponder resp = (XmlRpcResponder)responder;

            if (resp.HttpReq.HttpMethod == "POST")
            {
                try
                {
                    resp.Respond();
                }
                catch (Exception e)
                {
                    Logger.WriteEntry(string.Format("Failed on post: {0}", e), LogLevel.Error);
                }
            }
            else
            {
                Logger.WriteEntry(string.Format("Only POST methods are supported: {0} ignored", resp.HttpReq.HttpMethod), LogLevel.Error);
            }

            resp.Close();
        }