示例#1
0
        static void Main(string[] args)
        {
            var config = IOHelper.ReadFromJson <Config>("./");

            DealRequest.InitConfig(config);
            HttpServer.Start(config);
        }
示例#2
0
        private static void OnGet(HttpListenerContext context)
        {
            //deal
            var res = DealRequest.Run(context);

            //callback
            using (StreamWriter writer = new StreamWriter(context.Response.OutputStream))
            {
                writer.Write(res);

                writer.Close();
                context.Response.Close();
            }

            /*
             * string data = context.Request.QueryString["data"];
             *
             * if (data != null)
             * {
             *  Console.WriteLine("  Data:{0}", data);
             * }
             *
             * context.Response.StatusCode = (int)HttpStatusCode.OK;
             * using (StreamWriter writer = new StreamWriter(context.Response.OutputStream))
             * {
             *  var pachinkoRes = new PachinkoRes() { data = data };
             *  var pachinkoResJson = JsonMapper.ToJson(pachinkoRes);
             *  writer.Write(pachinkoResJson);
             *
             *  writer.Close();
             *  context.Response.Close();
             * }
             */

            //@TODO
            //Send TO DIO
        }