Пример #1
0
        public RequestHandler(Application application_, HTTPRequest request_, Dictionary<string, object> kwargs)
        {
            //def __init__(self, application, request, **kwargs):
            //super(RequestHandler, self).__init__()

            application = application_;
            request = request_;
            _headers_written = false;
            _finished = false;
            _auto_finish = true;

            _transforms = null;  // will be set in _execute
            //todo implement 
            /*self.ui = ObjectDict((n, self._ui_method(m)) for n, m in
                         application.ui_methods.iteritems())*/
            // UIModules are available as both `modules` and `_modules` in the
            // template namespace.  Historically only `modules` was available
            // but could be clobbered by user additions to the namespace.
            // The template {% module %} directive looks in `_modules` to avoid
            // possible conflicts.
            /*self.ui["_modules"] = ObjectDict((n, self._ui_module(n, m)) for n, m in
                                     application.ui_modules.iteritems())
            self.ui["modules"] = self.ui["_modules"]*/
            clear();
            // Check since connection is not available in WSGI
            if (request.connection != null)
                request.connection.stream.set_close_callback(on_connection_close);
            initialize(kwargs);
        }
Пример #2
0
        static void Main(string[] args)
        {
            var application = new Application(new TupleList<string, CreateRequestHandler, Dictionary<string, object>> {
                {"/", (app, req, args_) => new MainHandler(app, req, args_), null}});

            var http_server = new HTTPServer(application.Call);
            http_server.listen(8888);
            IOLoop.instance().start();
        }
Пример #3
0
 public StaticFileHandler(Application application_, HTTPRequest request_, Dictionary<string, object> kwargs)
     : base(application_, request_, kwargs)
 {
 }