Example #1
0
        private static async void PerformWSAction(HttpListenerContext context, RequestParams reqPar,
                                                  RPluginCollection plugins, RHttpAction wsact)
        {
            var wsc = await context.AcceptWebSocketAsync(wsact.WSProtocol);

            wsact.WSAction(new RRequest(context.Request, reqPar, plugins), new WebSocketDialog(wsc));
        }
Example #2
0
 internal RRequest(HttpListenerRequest req, RequestParams par, RPluginCollection pluginCollection)
 {
     UnderlyingRequest = req;
     Params            = par;
     _rp      = pluginCollection;
     _cookies = new Lazy <RCookies>(() => new RCookies(UnderlyingRequest.Cookies));
     _headers = new Lazy <RHeaders>(() => new RHeaders(UnderlyingRequest.Headers));
     _queries = new Lazy <RQueries>(() => new RQueries(UnderlyingRequest.QueryString));
 }
 internal RResponse(HttpListenerResponse res, RPluginCollection rPluginCollection)
 {
     UnderlyingResponse = res;
     Plugins            = rPluginCollection;
 }
Example #4
0
        private static void PerformAction(HttpListenerContext context, RequestParams reqPar, RPluginCollection plugins,
                                          RHttpAction act)
        {
            var req = new RRequest(context.Request, reqPar, plugins);
            var res = new RResponse(context.Response, plugins);

            act.Action(req, res);
        }