feat: add -ERR response infrastructure with SendErrAsync and SendErrAndCloseAsync

This commit is contained in:
Joseph Doherty
2026-02-22 21:37:32 -05:00
parent 8ee5a7f97b
commit 19e8c65f6d
3 changed files with 95 additions and 3 deletions

View File

@@ -19,6 +19,13 @@ public static class NatsProtocol
public static readonly byte[] MsgPrefix = "MSG "u8.ToArray();
public static readonly byte[] HmsgPrefix = "HMSG "u8.ToArray();
public static readonly byte[] ErrPrefix = "-ERR "u8.ToArray();
// Standard error messages (matching Go server)
public const string ErrMaxConnectionsExceeded = "maximum connections exceeded";
public const string ErrStaleConnection = "Stale Connection";
public const string ErrMaxPayloadViolation = "Maximum Payload Violation";
public const string ErrInvalidPublishSubject = "Invalid Publish Subject";
public const string ErrInvalidSubject = "Invalid Subject";
}
public sealed class ServerInfo