Skip to content

Conversation

@kasimlyee
Copy link

Pull Request

Related Issues

  • Closes #

What’s Changed

Refactored server to maintain persistent client connections list
Added proper disconnect detection and cleanup
Improved error handling for network operations

Why

Problem: Ghost clients
The original server didn't track connected clients. When a client disconnected, the server would still try to send messages to 4 clients instead of 3, but wouldn't detect the failure. This led to silent errors and poor connection management.

Notes for Reviewers

Server now uses Arc<Mutex<Vec>> to maintain shared client list across threads

Checklist

Tests pass locally
Verified server correctly tracks client count through connect/disconnect cycles
Tested with multiple simultaneous clients

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant