refactor(interfaces): add unified protocol interfaces (IProtocolClient, IProtocolServer)#594
Merged
Merged
Conversation
Introduce i_protocol_client and i_protocol_server interfaces to establish common contracts across all protocol implementations (TCP, UDP, HTTP, WebSocket, QUIC). Features: - Unified client lifecycle: start(), stop(), send(), is_connected() - Unified server lifecycle: start(), stop(), connection_count() - Observer pattern support via connection_observer - Comprehensive documentation with protocol-specific notes - Modern C++ design (VoidResult, std::string_view, move semantics) Benefits: - Eliminates code duplication across protocols - Enables protocol-agnostic facade patterns - Simplifies testing with consistent contracts - Provides foundation for EPIC #577 facade implementation Part of #577
14 tasks
Contributor
Performance ComparisonBase Branch ResultsNo base results PR Branch ResultsNo PR results |
This was referenced Feb 2, 2026
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
Introduce i_protocol_client and i_protocol_server interfaces to establish common contracts across all protocol implementations (TCP, UDP, HTTP, WebSocket, QUIC). Features: - Unified client lifecycle: start(), stop(), send(), is_connected() - Unified server lifecycle: start(), stop(), connection_count() - Observer pattern support via connection_observer - Comprehensive documentation with protocol-specific notes - Modern C++ design (VoidResult, std::string_view, move semantics) Benefits: - Eliminates code duplication across protocols - Enables protocol-agnostic facade patterns - Simplifies testing with consistent contracts - Provides foundation for EPIC #577 facade implementation Part of #577
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Summary
Introduces two core unified interfaces (
i_protocol_clientandi_protocol_server) that establish common contracts across all protocol implementations (TCP, UDP, HTTP, WebSocket, QUIC).Change Type
Affected Components
include/kcenon/network/interfaces/i_protocol_client.h- New client interfaceinclude/kcenon/network/interfaces/i_protocol_server.h- New server interfaceWhy
Related Issues
Closes #593
Part of #577 (EPIC: Apply Facade pattern to reduce protocol header complexity)
Motivation
Currently, each protocol (TCP, UDP, HTTP, WebSocket, QUIC) has its own client/server structure with duplicated patterns. This creates:
These unified interfaces provide:
Who
Reviewers
@kcenon - Architecture review
When
Urgency
Target Release
Milestone: EPIC #577 completion
Where
Files Created
include/kcenon/network/interfaces/i_protocol_client.hinclude/kcenon/network/interfaces/i_protocol_server.hDesign Decisions
Both interfaces:
i_network_componentfor common lifecycle methodsVoidResultreturn type for error handling consistencyconnection_observerHow
Implementation Highlights
i_protocol_client Interface
start(),stop(),is_connected()send()with move semanticsi_protocol_server Interface
start(),stop(),connection_count()i_sessioninterfaceDocumentation
Testing Done
Test Plan for Reviewers
cmake --build build --config Releasei_clientandi_serverBreaking Changes
None - This is an additive change. Existing code is not modified.
Protocols will be updated in subsequent PRs to implement these interfaces.
Next Steps
After this PR merges:
i_protocol_client/i_protocol_serverChecklist