namespace ZB.MOM.WW.MxGateway.Contracts; /// /// Holds the protocol version constants shared by gateway components. /// is advertised to clients in /// OpenSessionReply; is used to /// validate WorkerEnvelope protocol framing on the gateway↔worker pipe. /// public static class GatewayContractInfo { /// Protocol version advertised to clients in OpenSessionReply. public const uint GatewayProtocolVersion = 3; /// Protocol version used to validate WorkerEnvelope framing on the gateway-worker pipe. public const uint WorkerProtocolVersion = 1; /// Default backend name identifying the MXAccess worker process type. public const string DefaultBackendName = "mxaccess-worker"; /// /// Ceiling on how many events one DrainEvents command may move in a single reply. /// Shared so the gateway's request-validation ceiling /// (MxAccessGrpcRequestValidator, which rejects a larger max_events loudly at /// the public boundary) and the worker's per-reply clamp /// (WorkerPipeSession.CreateDrainEventsReply, the backstop that also interprets /// max_events = 0) cannot drift apart. A count cap alone is necessary but not /// sufficient: the worker additionally caps the reply by serialized bytes against the /// negotiated frame maximum (WRK-21), so a reply may carry fewer events than this ceiling /// and fewer than are queued. Callers drain iteratively until an empty reply. /// This is a documented behavioral bound, not wire schema — it is deliberately a C# /// constant and not a .proto field. /// public const uint MaxDrainEventsPerCommand = 10_000; /// /// Environment variable name that opts an xUnit suite into running live /// MXAccess COM tests. Single source of truth shared by both /// ZB.MOM.WW.MxGateway.IntegrationTests.LiveMxAccessFactAttribute and /// ZB.MOM.WW.MxGateway.Worker.Tests.TestSupport.LiveMxAccessFactAttribute /// so any future opt-in tweak does not silently leave one project /// behind. /// public const string LiveMxAccessOptInVariableName = "MXGATEWAY_RUN_LIVE_MXACCESS_TESTS"; }