Exemplo n.º 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));
        }
Exemplo n.º 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));
 }
Exemplo n.º 3
0
 internal RResponse(HttpListenerResponse res, RPluginCollection rPluginCollection)
 {
     UnderlyingResponse = res;
     Plugins            = rPluginCollection;
 }
Exemplo n.º 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);
        }