Objective
Write a TCP chat relay that listens on 127.0.0.1, accepts many clients at once, and forwards every message it receives to all the other connected clients. A single thread must stay responsive at all times, so the program is built around one I/O multiplexing loop and never blocks on a slow peer.
Steps
$ peer 0 connects, then peer 1 connects
relay: peer 1 joined
$ peer 0 sends "lgtm merge it\n"
peer 0 says: lgtm merge it
$ peer 0 sends "who broke main" then later "?\n"
peer 0 says: who broke main?
Expected files
Allowed functions

Objective
Write a TCP chat relay that listens on 127.0.0.1, accepts many clients at once, and forwards every message it receives to all the other connected clients. A single thread must stay responsive at all times, so the program is built around one I/O multiplexing loop and never blocks on a slow peer.
Steps
$ peer 0 connects, then peer 1 connects
relay: peer 1 joined
$ peer 0 sends "lgtm merge it\n"
peer 0 says: lgtm merge it
$ peer 0 sends "who broke main" then later "?\n"
peer 0 says: who broke main?
Expected files
Allowed functions

Tests
Run the tests to grade your code