Beispiel #1
0
        protected override void OnClose(CloseEventArgs e)
        {
            WebsocketDisconnectEventArgs wd = new WebsocketDisconnectEventArgs(WebsocketEventType.Disconnect, e.Reason, e.WasClean);

            WebsocketEventManager.FireWebsocketAction(wd);
            base.OnClose(e);
        }
Beispiel #2
0
        protected override void OnError(ErrorEventArgs e)
        {
            WebsocketErrorEventArgs we = new WebsocketErrorEventArgs(WebsocketEventType.Error, e.Message);

            WebsocketEventManager.FireWebsocketAction(we);
            base.OnError(e);
        }
Beispiel #3
0
        protected override void OnOpen()
        {
            WebsocketOpenEventArgs wo = new WebsocketOpenEventArgs(WebsocketEventType.Connect);

            WebsocketEventManager.FireWebsocketAction(wo);
            base.OnOpen();
        }
Beispiel #4
0
        protected override void OnMessage(MessageEventArgs e)
        {
            WebsocketMessageEventArgs wm = new WebsocketMessageEventArgs(WebsocketEventType.Receive,
                                                                         e.Data,
                                                                         e.IsBinary,
                                                                         e.IsPing,
                                                                         e.IsText,
                                                                         e.RawData);

            WebsocketEventManager.FireWebsocketAction(wm);
            BroadcastMessageAllAsync(e.Data);
            base.OnMessage(e);
        }