コード例 #1
0
ファイル: HandshakeFraming.cs プロジェクト: Drawaes/Leto2
        public static void WriteHandshakeFrame(this ConnectionStates.ConnectionState state, int contentSize, BufferExtensions.ContentWriter content, HandshakeType handshakeType)
        {
            var writer = new WriterWrapper(state.Connection.HandshakeOutput.Writer.Alloc(), state.HandshakeHash);

            writer.WriteBigEndian(handshakeType);
            writer.WriteBigEndian((UInt24)contentSize);
            content(ref writer);
            Debug.Assert((writer.BytesWritten - 4) == contentSize);
            writer.Commit();
        }