コード例 #1
0
 public void Respond(INetworkUtillity util)
 {
 }
コード例 #2
0
        public void Respond(INetworkUtillity util)
        {
            action = DetermineOrder(message);
            var args = DetermineArgs(message,action);
            Console.WriteLine("\nPost action was: " + action);
            Console.WriteLine("With arguments: ");
            foreach (var arg in args)
            {
                Console.Write(arg.ArgName + ": " + arg.ArgVal);
            }

            orderClass = new Order(action, util);
            orderClass.execOrder(args);
        }
コード例 #3
0
        public void Respond(INetworkUtillity utillity)
        {
            string body = XMLreader.Read();
            string head = "HTTP/1.1 200 OK\r\n" +
                          "CONTENT-TYPE: text/xml;charset=utf-8\r\n" +
                          "CONTENT-LENGTH: " + body.Length + "\r\n";

            string message = head + "\r\n" + body;

            Console.WriteLine("TCP Message: \r\n" + message);

            try
            {
                utillity.Send(message);
            }
            catch (Exception)
            {
                Console.WriteLine("Exception in Reponse");
                throw;
            }
        }
コード例 #4
0
        public Order(string order, INetworkUtillity utillity)
        {
            action = order;
            invokeResponseGen = new InvokeResponseGen();
            util = utillity;

            timer = new System.Timers.Timer();
        }
コード例 #5
0
        /// <summary>
        /// Get data from message and send them to publisher. 
        /// Sends correct event data back to Control point
        /// based on message type. 
        /// </summary>
        /// <param name="util">NetworkUtility used to handle communication with Control Point</param>
        public void Respond(INetworkUtillity util)
        {
            string SID = GetSid (_rec);
            string createdHead;

            if (SID == null)
            {

                string subscriberUrl = GetURL (_rec);
                string uuid = Guid.NewGuid ().ToString ();

                createdHead = GetHeadNewSubscriberResponse (_rec, uuid);
                _pub.NewSubscriber (uuid, subscriberUrl);
            }
            else
            {
                createdHead = GetHeadRenewResponse (_rec, SID);
            }
            util.Send(createdHead);
        }