Пример #1
0
        public void SetWriteRequest(int sessionId, ReadOnlySpan <byte> message)
        {
            EntryType = SendRequestEntryType.Send;
            SessionId = sessionId;

            // The actual buffer segment is located right at the end of the current struct
            var bufferSegmentStart = GetBufferSegmentStart();

            Unsafe.Write(bufferSegmentStart, message.Length);
            message.CopyTo(new Span <byte>(bufferSegmentStart + sizeof(int), message.Length));

            RioBufferSegmentDescriptor.Length = sizeof(int) + message.Length;
        }
Пример #2
0
 public void Reset()
 {
     EntryType = SendRequestEntryType.Undefined;
     RioBufferSegmentDescriptor.Length = default;
     SessionId = default;
 }