Problem
The server configuration has duplicated bind logic in both the Unbound and Bound implementations. The bind() and bind_listener() methods contain similar logic across different server states, leading to code duplication and maintenance overhead.
Suggested Solution
Refactor the duplicated bind logic into a single private helper function to reduce repetition and simplify maintenance. This would centralise the binding logic and make it easier to modify in the future.
Context
Identified during code review of PR #262: #262
Issue: #275
Files Affected
Related Issues
Problem
The server configuration has duplicated bind logic in both the
UnboundandBoundimplementations. Thebind()andbind_listener()methods contain similar logic across different server states, leading to code duplication and maintenance overhead.Suggested Solution
Refactor the duplicated bind logic into a single private helper function to reduce repetition and simplify maintenance. This would centralise the binding logic and make it easier to modify in the future.
Context
Identified during code review of PR #262: #262
Issue: #275
Files Affected
src/server/config.rsRelated Issues