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; }
public void Reset() { EntryType = SendRequestEntryType.Undefined; RioBufferSegmentDescriptor.Length = default; SessionId = default; }