AyCode.Core/AyCode.Services/SignalRs
Loretta 17daf0fef2 Document AcBinary wire format, sync docs, update conventions
- Add BINARY_FORMAT.md: full AcBinary wire format spec (markers, encoding, options, protocol, interactions)
- Reference BINARY_FORMAT.md from GLOSSARY.md, Binaries/README.md, and Serializers/Binaries/README.md; add new glossary terms
- Clarify and expand config options tables to match new doc
- Add/clarify LLM maintenance rules: always sync .md files with code, auto-fix discrepancies
- Update root README.md: AyCode.Core targets .NET 9, not 10; stress doc/code sync
- Add code reuse and doc sync conventions to copilot-instructions.md and CONVENTIONS.md
- Add docs/ folder and BINARY_FORMAT.md to solution as Solution Items
- Minor clarifications and cross-links in ARCHITECTURE.md and other docs
2026-03-29 09:11:57 +02:00
..
AcBinaryHubProtocol.cs Add high-performance binary output abstraction 2026-02-10 07:12:11 +01:00
AcSignalRClientBase.cs Refactor serializer options, string fast paths & analysis 2026-01-25 16:40:40 +01:00
AcSignalRTags.cs Refactor JSON/SignalR infra; add full test & benchmark suite 2025-12-11 21:25:50 +01:00
IAcSignalRHubBase.cs SignalR improvements; 2025-10-30 14:55:47 +01:00
IAcSignalRHubClient.cs Switch to binary serialization; add IEntityComment interface 2026-03-06 14:51:06 +01:00
README.md Document AcBinary wire format, sync docs, update conventions 2026-03-29 09:11:57 +02:00
SendToClientType.cs SignalR improvements; 2025-10-30 14:55:47 +01:00
SignalMessageTagAttribute.cs SignalR improvements; 2025-10-30 14:55:47 +01:00
SignalRCrudTags.cs improvements, fixes 2024-06-09 11:13:23 +02:00
SignalRRequestModel.cs Fix binary deserializer string interning and add regressions 2025-12-13 00:12:21 +01:00
SignalRSerializationHelper.cs Refactor serializer options, string fast paths & analysis 2026-01-25 16:40:40 +01:00

README.md

SignalRs

Custom binary SignalR protocol, client infrastructure, message tagging, and serialization helpers.

Key Files

Protocol

  • AcBinaryHubProtocol.cs — Custom IHubProtocol replacing JSON+Base64 with AcBinarySerializer. Handles all 9 SignalR message types (Invocation, StreamItem, Completion, Ping, Close, etc.). Inner SpanReader ref struct for zero-alloc parsing.

Client

  • AcSignalRClientBase.cs — Abstract SignalR client managing HubConnection, request/response tracking via pooled SignalRRequestModel. Methods: SendMessageToServerAsync<TResponse>(), CRUD helpers (Post, Get, GetAll, GetAllInto). Configurable timeouts.
  • IAcSignalRHubClient.cs — Client interface + SignalResponseDataMessage (sealed, supports JSON/Binary with GZip, caching, diagnostics).
  • IAcSignalRHubBase.cs — Base hub interface: OnReceiveMessage(int messageTag, byte[] messageBytes, int? requestId).

Message Tagging

  • SignalMessageTagAttribute.cs — Three attributes: TagAttribute (base, int messageTag), SignalRAttribute (server method routing + client notification), SignalRSendToClientAttribute (client-side receive).
  • AcSignalRTags.cs — Static constants: None, PingTag, EchoTag.
  • SignalRCrudTags.cs — Sealed record mapping 5 CRUD tags. GetMessageTagByTrackingState() maps TrackingState → tag.
  • SendToClientType.cs — Enum: None, Others, Caller, All.

Serialization & Pooling

  • SignalRSerializationHelper.cs — Static helpers: SerializeToBinary(), DeserializeFromBinary(), compressed JSON variants, CreateResponseData().
  • SignalRRequestModel.cs — Poolable (IResettable) request tracking model with ObjectPool for reuse.