How prajwal-kr-12/chat-application works
This is a small terminal chat application: a user chooses a nickname and types messages in a client, which connects to a central TCP server; the server manages connected clients and broadcasts messages to other participants. On the client, separate receive and write loops handle incoming messages and user input. On the server, the accept loop registers clients and starts a handler per connection; handlers forward messages to the broadcaster, which also handles failed sends and disconnections. The map follows the README and the two excerpted source files.
Main entry points: server.py Message broadcaster · client.py TCP client connection
Components 8
Chat client
- TCP client connection
client.py - Receive loop
client.py - Write loop
client.py
Chat server
- Accept and register
server.py - Client registry
server.py - Client handler
server.py - Message broadcaster
server.py
Other components
- Terminal user
Connections 12
- Terminal user → TCP client connection: chooses nickname
README.md - TCP client connection → Accept and register: connects by TCP
README.md - Accept and register → Client registry: stores client
server.py - Accept and register → Client handler: starts thread
server.py - Accept and register → Message broadcaster: announces arrival
server.py - Terminal user → Write loop: types messages
README.md - Write loop → TCP client connection: sends messages
client.py - TCP client connection → Receive loop: receives data
client.py - Client handler → Message broadcaster: forwards messages
server.py - Message broadcaster → Client registry: reads recipients
server.py - Message broadcaster → TCP client connection: broadcasts messages
README.md - Message broadcaster → Client registry: removes failed clients
server.py