Exemplo n.º 1
0
        internal void SendFrame(BaseFrame frame)
        {
            byte[] data = frame.Serialize();

            if (_secure)
            {
                EncodeInternal(data, 0, (ushort)data.Length);
            }
            else
            {
                OnDataEncoded(data, 0, data.Length, new byte[0]);
            }
        }
Exemplo n.º 2
0
        internal void BufferFrame(BaseFrame frame, FrameState state)
        {
            _frame          = frame;
            _state          = state;
            _bufferPosition = 0;

            if (_secure)
            {
                _bytesToBuffer = PREFIX_SIZE;
            }
            else
            {
                _bytesToBuffer = frame.InitialSize;
            }
        }
Exemplo n.º 3
0
        internal override void OnFrameProcessed(BaseFrame frame)
        {
            switch (State)
            {
            case FrameState.ClientNegotiate:
                HandleNegotiateFrame((ClientNegotiateFrame)frame);
                break;

            case FrameState.ClientExchange:
                HandleExchangeFrame((ClientExchangeFrame)frame);
                break;

            case FrameState.ClientEcho:
                HandleEchoFrame((ClientEchoFrame)frame);
                break;
            }
        }
Exemplo n.º 4
0
        internal override void OnFrameProcessed(BaseFrame frame)
        {
            switch (State)
            {
            case FrameState.ServerNegotiate:
                HandleNegotiateFrame((ServerNegotiateFrame)frame);
                break;

            case FrameState.ServerExchange:
                HandleExchangeFrame((ServerExchangeFrame)frame);
                break;

            case FrameState.ServerValidate:
                HandleValidateFrame((ServerValidateFrame)frame);
                break;

            case FrameState.ServerEcho:
                HandleEchoFrame((ServerEchoFrame)frame);
                break;
            }
        }
Exemplo n.º 5
0
 internal abstract void OnFrameProcessed(BaseFrame frame);