Ejemplo n.º 1
0
        private void SendNegotiateFrame()
        {
            ServerNegotiateFrame frame = new ServerNegotiateFrame();

            frame.MinVersion = MIN_VERSION;
            frame.MaxVersion = MAX_VERSION;

            SendFrame(frame);
        }
Ejemplo n.º 2
0
        private void HandleNegotiateFrame(ServerNegotiateFrame frame)
        {
            if (frame.MinVersion > MAX_VERSION || frame.MaxVersion < MIN_VERSION)
            {
                OnExceptionThrown(new InvalidDataException("Invalid protocol version."));
                return;
            }

            Version     = Math.Min(frame.MaxVersion, MAX_VERSION);
            ServerNonce = CreateNonce(NONCE_LENGTH);

            BufferFrame(new ServerExchangeFrame(), FrameState.ServerExchange);
            SendNegotiateFrame();
        }