docs(bg,en): fix ports and WebSocket example for new server model
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled

- Update architecture diagram to include WebSocket server (port 9913)
- Fix HTTP port from 9470 to 9912 (TCP + 440) in protocol docs
- Fix WebSocket port from 9471 to 9913 (TCP + 441) in protocol docs
- Fix WebSocket Nim example: remove non-existent onMessage API and
  unsafe cast[string](data), use correct WsServer API with safe helpers
- Clarify TCP_NODELAY is also handled internally by hunos (HTTP)
- Note that bytesToString/stringToBytes are wire-protocol helpers
This commit is contained in:
2026-05-18 19:41:21 +03:00
parent 8afa998516
commit 343f479127
4 changed files with 36 additions and 22 deletions
+10 -5
View File
@@ -45,15 +45,20 @@ The TCP and HTTP servers share a single LSMTree instance to ensure data consiste
├────────────────────────┬────────────────────────────────┤
│ TCP Server │ HTTP Server │
│ (Binary Protocol) │ (REST API) │
│ Port: 9472 │ Port: 9912
│ Port: 9472 │ Port: 9912 (TCP + 440)
│ TCP_NODELAY: ON │ Multi-threaded │
────────────────────────┴────────────────────────────────
────────────────────────┴────────────────────────────────
│ WebSocket Server │
│ (Streaming/Pub-Sub) │
│ Port: 9913 (TCP + 441) │
│ TCP_NODELAY: ON │
└─────────────────────────────────────────────────────────┘
```
**Key optimizations:**
- **Shared LSMTree** — Both servers operate on the same database instance, eliminating data inconsistency
- **TCP_NODELAY** — Enabled on both listening and client sockets for lower latency on small messages
- **Safe byte conversion** — Proper `bytesToString`/`stringToBytes` functions instead of unsafe `cast` operations
- **Shared LSMTree** — All servers operate on the same database instance, eliminating data inconsistency
- **TCP_NODELAY** — Enabled on listening and client sockets in TCP/WebSocket servers for lower latency on small messages. The HTTP server (via hunos) also handles `TCP_NODELAY` internally.
- **Safe byte conversion** — Proper `bytesToString`/`stringToBytes` functions instead of unsafe `cast` operations in the wire protocol
### Connection Management