public static FrameCommandBase CreateCommand(FrameStreamReader reader)
        {
            FrameCommandBase command = null;

            if (reader.Opcode == Opcodes.BinaryFrame)
            {
                command = new BinaryCommand(reader);
            }
            else if (reader.Opcode == Opcodes.ConnectionClose)
            {
                command = new ConnectionCloseCommand(reader);
            }
            else if (reader.Opcode == Opcodes.TextFrame)
            {
                command = new TextCommand(reader);
            }
            else if (reader.Opcode == Opcodes.ContinuationFrame)
            {
            }
            else if (reader.Opcode == Opcodes.Ping)
            {
                command = new PingCommand(reader);
            }
            else if (reader.Opcode == Opcodes.Pong)
            {
                command = new PongCommand(reader);
            }

            return(command);
        }
예제 #2
0
        public override Dynamic.Net.Base.INetCommand Execute(Dynamic.Net.Base.INetSession session)
        {
            WebSocketSession ws = session as WebSocketSession;

            if (ws == null)
            {
                return(null);
            }

            PongCommand pongCommand = new PongCommand();

            pongCommand.InnerData = this.InnerData;


            return(pongCommand);
        }