Beispiel #1
0
        public WorkerRequest(LyoHost host, HttpProcessor processor, RequestInfo requestInfo)
        {
            _host        = host;
            _processor   = processor;
            _requestInfo = requestInfo;

            _responseHeaders   = new Dictionary <string, string>();
            _responseBodyBytes = new List <byte[]>();

            ParseRequestHeaders();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            int    port;
            string dir = Directory.GetCurrentDirectory();

            if (args.Length == 0 || !int.TryParse(args[0], out port))
            {
                port = int.Parse(Config.CreatInstance().GetConfigValue("port"));
            }

            InitHostFile(dir);
            LyoHost host = (LyoHost)ApplicationHost.CreateApplicationHost(typeof(LyoHost), "/", dir);

            host.Config("/", dir);

            WebServer server = new WebServer(host, port);

            server.Start();
        }
Beispiel #3
0
 public WebServer(LyoHost host, int port)
 {
     _host = host;
     Port  = port;
 }
Beispiel #4
0
 public HttpProcessor(LyoHost host, Socket socket)
 {
     _host   = host;
     _socket = socket;
 }