示例#1
0
    private void PerformHandshake()
    {
        PacketWriter handshake = HandshakePacket.Handshake(VERSION, Riv, Siv, BLOCK_IV, Type, HANDSHAKE_SIZE);

        // No encryption for handshake
        using PoolPacketWriter packet = SendCipher.WriteHeader(handshake.Buffer, 0, handshake.Length);
        Logger.Debug($"Handshake: {packet}");
        SendRaw(packet);
    }
示例#2
0
    private void PerformHandshake()
    {
        var handshake = new ByteWriter(HANDSHAKE_SIZE);

        handshake.Write <ushort>(SendOp.REQUEST_VERSION);
        handshake.Write <uint>(VERSION);
        handshake.Write <uint>(riv);
        handshake.Write <uint>(siv);
        handshake.Write <uint>(BLOCK_IV);
        handshake.WriteByte((byte)Type);

        // No encryption for handshake
        using PoolByteWriter packet = sendCipher.WriteHeader(handshake.Buffer, 0, handshake.Length);
        logger.LogDebug("Handshake: {Packet}", packet);
        SendRaw(packet);
    }