feat: add ClosedState enum ported from Go client.go
This commit is contained in:
52
src/NATS.Server/ClosedState.cs
Normal file
52
src/NATS.Server/ClosedState.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
// Ported from Go: server/client.go:188-228
|
||||
|
||||
namespace NATS.Server;
|
||||
|
||||
/// <summary>
|
||||
/// Reason a client connection was closed. Stored in connection info for monitoring
|
||||
/// and passed to close handlers during connection teardown.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Values start at 1 (matching Go's <c>iota + 1</c>) so that the default zero value
|
||||
/// is distinct from any valid close reason.
|
||||
/// </remarks>
|
||||
public enum ClosedState
|
||||
{
|
||||
ClientClosed = 1,
|
||||
AuthenticationTimeout,
|
||||
AuthenticationViolation,
|
||||
TLSHandshakeError,
|
||||
SlowConsumerPendingBytes,
|
||||
SlowConsumerWriteDeadline,
|
||||
WriteError,
|
||||
ReadError,
|
||||
ParseError,
|
||||
StaleConnection,
|
||||
ProtocolViolation,
|
||||
BadClientProtocolVersion,
|
||||
WrongPort,
|
||||
MaxAccountConnectionsExceeded,
|
||||
MaxConnectionsExceeded,
|
||||
MaxPayloadExceeded,
|
||||
MaxControlLineExceeded,
|
||||
MaxSubscriptionsExceeded,
|
||||
DuplicateRoute,
|
||||
RouteRemoved,
|
||||
ServerShutdown,
|
||||
AuthenticationExpired,
|
||||
WrongGateway,
|
||||
MissingAccount,
|
||||
Revocation,
|
||||
InternalClient,
|
||||
MsgHeaderViolation,
|
||||
NoRespondersRequiresHeaders,
|
||||
ClusterNameConflict,
|
||||
DuplicateRemoteLeafnodeConnection,
|
||||
DuplicateClientID,
|
||||
DuplicateServerName,
|
||||
MinimumVersionRequired,
|
||||
ClusterNamesIdentical,
|
||||
Kicked,
|
||||
ProxyNotTrusted,
|
||||
ProxyRequired,
|
||||
}
|
||||
Reference in New Issue
Block a user