mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 12:49:35 -10:00
Instead of ReadMessageHeaderAsync, use a pair of EnsureBufferContainsHeaderAsync and ParseMessageHeaderFromReceiveBuffer, which avoids several allocations in the case of the header already being in the buffer and using smaller allocations if one isn't. Commit migrated from https://github.com/dotnet/corefx/commit/c96eee1452e0293ceb70bb2dc0c55007c36ef621