コード例 #1
0
        public static bool TrySlice(MemoryCursor cursor)
        {
            if (!HandshakeType.TrySlice(cursor, HandshakeType.EncryptedExtensions))
            {
                return(false);
            }

            HandshakeLength.SliceBytes(cursor);

            return(true);
        }
コード例 #2
0
        public static void WriteEmpty(MemoryCursor cursor)
        {
            HandshakeType.EncryptedExtensions.WriteBytes(cursor);

            using (HandshakeLength.StartWriting(cursor))
            {
                var bytes = cursor.Move(2).Span;

                bytes[0] = 0;
                bytes[1] = 0;
            }
        }
コード例 #3
0
        public static bool TryParse(MemoryCursor cursor, out MemoryBuffer verifyData)
        {
            verifyData = new MemoryBuffer();

            if (!HandshakeType.TrySlice(cursor, HandshakeType.Finished))
            {
                return(false);
            }

            verifyData = HandshakeLength.SliceBytes(cursor);

            return(true);
        }
コード例 #4
0
        public static HandshakeLength.CursorWritingContext StartWriting(MemoryCursor cursor)
        {
            HandshakeType.Finished.WriteBytes(cursor);

            return(HandshakeLength.StartWriting(cursor));
        }
コード例 #5
0
 public static void SliceBytes(MemoryCursor cursor)
 {
     HandshakeType.Parse(cursor);
     HandshakeLength.SliceBytes(cursor);
 }