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]); } }
internal void BufferFrame(BaseFrame frame, FrameState state) { _frame = frame; _state = state; _bufferPosition = 0; if (_secure) { _bytesToBuffer = PREFIX_SIZE; } else { _bytesToBuffer = frame.InitialSize; } }
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; } }
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; } }
internal abstract void OnFrameProcessed(BaseFrame frame);