Пример #1
0
        public virtual void OnPong(Session session, byte[] data)
        {
            WebSocketEventPackage events = Events as WebSocketEventPackage;

            if (events != null)
            {
                events.FirePongEvent(session, data);
            }
        }
Пример #2
0
        public virtual void OnHandshake(Session session)
        {
            WebSocketEventPackage events = Events as WebSocketEventPackage;

            if (events != null)
            {
                events.FireHandshakeEvent(session);
            }
        }
Пример #3
0
        public virtual void OnPing(Session session, byte[] data)
        {
            WebSocketEventPackage events = Events as WebSocketEventPackage;

            if (events != null)
            {
                events.FirePingEvent(session, data);
            }

            session.Send(WebMessage.CreatePongMessage(data));
        }
Пример #4
0
        public override void SetIoHandler(INetworkEventHandler handler)
        {
            base.SetIoHandler(handler);
            if (handler is NetworkEventHandler)
            {
                m_Events   = ((handler as NetworkEventHandler).Events) as WebSocketEventPackage;
                m_Handlers = (handler as NetworkEventHandler).GetHandlerManager();
            }

            if (m_Events != null)
            {
                m_Events.OnConnect += WhenTcpSocketConnected;
            }
        }