C#: a forward is retryable only when provably not sent; unconfirmed otherwise; refusals carry fixed text
Some checks failed
CultMesh QUIC native / Build win32-x64 (pull_request) Has been skipped
CultMesh QUIC native / Build linux-x64 (pull_request) Has been skipped
CultMesh QUIC native / Release native binaries (pull_request) Has been skipped
CultMesh QUIC native / Verify committed binaries match SHA256SUMS (pull_request) Has been cancelled
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled

CultNetWriteNotSentException names the pre-send boundary (connect, hello, no endpoint,
or a send port that proves nothing was written). Every other forwarding failure keeps
the session claim. ForUnownedSchema and the routing refusal no longer carry exception text.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Libby 2026-11-08 15:02:56 +00:00
commit 541d734675
7 changed files with 244 additions and 32 deletions

View file

@ -40,6 +40,24 @@ namespace GameCult.Networking
public string MessageId { get; }
}
/// <summary>
/// A forwarded write that provably never left this process: the connection failed, or the send failed before any byte was
/// written. It is the only forwarding failure after which the same id may be forwarded again. A send port that cannot prove
/// nothing was written must not throw this; every other failure of a forward is unconfirmed.
/// </summary>
public sealed class CultNetWriteNotSentException : Exception
{
/// <summary>Creates the exception for the write <paramref name="messageId"/>; <paramref name="cause"/> is for logs only.</summary>
public CultNetWriteNotSentException(string messageId, Exception? cause = null)
: base($"Write '{messageId}' was not sent.", cause)
{
MessageId = messageId;
}
/// <summary>Gets the id of the write that was not sent.</summary>
public string MessageId { get; }
}
/// <summary>
/// Completes a write on the peer's result frame, never on a send's return or a transport acknowledgement:
/// an ack proves delivery, not admission.