Skip to content

BInary and UDP (Take 2) #279

@tristanpoland

Description

@tristanpoland

Generalize Client Communication Stack to Support TCP/UDP and JSON/Binary

Currently, our entire client communication stack assumes TCP as the sole transport protocol and JSON as the default serialization format. This limits flexibility, performance tuning, and compatibility with various systems and use cases.

✨ Goal

Refactor the client communication stack to support any combination of:

  • Protocols: TCP and UDP
  • Serialization formats: JSON and Binary

This would enable:

  • Low-latency UDP event streams
  • High-performance binary protocols
  • Compile-time safety and flexibility for developers

🔧 Suggested Approach

Refer to the examples added in the Horizon Event System:

  • simple_protocol_demo.rs: TCP/UDP with JSON/binary serialization
  • simple_udp_demo.rs, udp_event_example.rs: Binary deserialization and mock UDP handling
  • zero_cost_example.rs: Compile-time enforcement of protocol/serialization combinations

✅ Acceptance Criteria

  • Transport layer can be either TCP or UDP
  • Serialization layer can be either JSON or binary
  • Compile-time validation of supported combinations
  • Minimal to zero runtime overhead
  • Backward-compatible fallback to TCP + JSON

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions