feat(mqtt): implement CONNECT/CONNACK/DISCONNECT packet handlers

Implement Task 3 of MQTT orchestration:
- Create MqttPacketHandlers.cs with ParseConnect(), ProcessConnect(), EnqueueConnAck(), HandleDisconnect()
- Wire CONNECT and DISCONNECT dispatch in MqttParser.cs
- Parse CONNECT: protocol name/level, flags, keep-alive, client ID, will, auth
- Send CONNACK (4-byte fixed packet with return code)
- DISCONNECT clears will message and closes connection cleanly
- Auto-generate client ID for empty ID + clean session
- Validate reserved bit, will flags, username/password consistency
- Add Reader field to MqttHandler for per-connection parsing
- 11 unit tests for CONNECT parsing and processing
- 1 end-to-end integration test: TCP → CONNECT → CONNACK over the wire
This commit is contained in:
Joseph Doherty
2026-03-01 15:48:22 -05:00
parent 2e2ffee41a
commit 95cf20b00b
6 changed files with 768 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
# NATS .NET Porting Status Report
Generated: 2026-03-01 20:41:46 UTC
Generated: 2026-03-01 20:48:23 UTC
## Modules (12 total)