Exemple #1
0
        public override void OnConnection(AspNetWebSocketContext context)
        {
            _sockets.TryAdd(_id, context);

            if (_onConnection == null)
            {
                return;
            }

            Action <object> callback = result => { };
            var             request  = new ServerRequest(_onConnection, _application, callback, _server.GetSession(_id), HttpContext.Current, _id);

            _application.AddRequest(request);
        }
Exemple #2
0
        public static void Send(JSApplication application, JSSession session, Action <object> callback, string data)
        {
            if (_onMessage == null)
            {
                return;
            }

            var request = new FunctionRequest(_onMessage, application, callback, session, data);

            application.AddRequest(request);
        }
Exemple #3
0
        public static void OnConnection(JSApplication application, JSSession session, Action after)
        {
            if (_onConnection == null)
            {
                return;
            }

            Action <object> callback = Callback(after, HttpContext.Current);
            var             request  = new ServerRequest(_onConnection, application, callback, session, HttpContext.Current);

            application.AddRequest(request);
        }