Skip to content

README: span overloads, thread safety and a 3.x to 4.0 upgrade section - #14

Merged
holonsoftFounder merged 1 commit into
mainfrom
docs/v4-readme
Sep 13, 2026
Merged

holonsoftFounder merged 1 commit into
mainfrom
docs/v4-readme

Conversation

@holonsoftFounder

Copy link
Copy Markdown
Member

What

  • The embedded copy of IProtocolConverter<T> still showed the interface as it was before the span overloads.
  • A section on reading out of a receive buffer without copying, with the loop a caller actually writes.
  • A thread safety statement: a prepared converter is safe to share, Prepare() is not, and a reused POCO instance belongs to one thread.
  • An Upgrading from 3.x to 4.0 section.

Why the upgrade section matters

Four things behave differently in 4.0, and the first one can change what a program does with no compiler error at all:

  1. Range limits are parsed with the invariant culture. Before, they used the machine culture, so MinValue = "-100.5" was read as -1005 on a German or French system. The range guard was wrong by a factor of ten, silently, and only on some machines.
  2. A truncated frame throws ProtocolConverterException instead of whatever the BCL happened to throw. Code catching ArgumentException around a conversion needs to change.
  3. IProtocolConverter<T> has two new members. Only affects hand written implementations and mocks.
  4. Guid respects UseBigEndian when writing. The reader always reversed, the writer ignored the flag, so a big endian Guid did not survive a round trip. Big endian Guid frames written by 3.x will now read differently. Little endian is unaffected.

The section also lists what was fixed (thread safety, decimal/sbyte, the minimum length check) and the measured speed up, with a pointer to baseline-before-v4.md for how each number was obtained.

The wire format itself did not change, which the byte exact golden vectors pin.

🤖 Generated with Claude Code

The README still showed the interface as it was before the span overloads, and
said nothing about what a 4.0 upgrade changes for an existing user. The four
behaviour changes are listed with the reason for each, the culture one first
because it is the only one that can change what a program does without any
compiler error.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@holonsoftFounder
holonsoftFounder merged commit 5c766a5 into main Sep 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant