Пример #1
0
        private bool checkFrameIsValid(WsFrame frame)
        {
            if (frame.IsNull())
            {
                var msg = "The WebSocket frame can not be read from the network stream.";
                close(CloseStatusCode.ABNORMAL, msg);

                return(false);
            }

            return(true);
        }
Пример #2
0
        private bool processAbnormal(WsFrame frame)
        {
            if (!frame.IsNull())
            {
                return(false);
            }

      #if DEBUG
            Console.WriteLine("WS: Info@processAbnormal: Start closing handshake.");
      #endif
            var msg = "What we've got here is a failure to communicate in the WebSocket protocol.";
            close(CloseStatusCode.ABNORMAL, msg);

            return(true);
        }