How armaanusmani/chatroom-server works
chatRoomCpp is a small TCP chat application: a client connects to the server, sends line-oriented input, and displays incoming messages. The server accepts connections into sessions; sessions join a room, relay incoming messages to it, and write broadcasts to other participants. Message provides the server-side encoding and decoding helpers. The README describes asynchronous I/O and threading; the excerpts show asynchronous server socket operations and a client input thread. The graph follows the excerpts and documented capabilities; it does not assume unshown runtime wiring.
Main entry points: chatRoom.cpp Client session · client.cpp Client app · message.hpp Message framing
Components 9
Client
- Client app
client.cpp - Input thread
client.cpp - Server receiver
client.cpp
Server and sessions
- Server accept loop
chatRoom.cpp - Client session
chatRoom.cpp
Room and messages
- Chat room
chatRoom.cpp - Message framing
message.hpp
Other components
- Chat user
- TCP connection
Connections 14
- Chat user → Input thread: enters messages
client.cpp - Client app → Input thread: starts thread
client.cpp - Client app → Server receiver: starts reading
client.cpp - Client app → TCP connection: connects to
client.cpp - Input thread → TCP connection: writes input
client.cpp - TCP connection → Server receiver: delivers replies
client.cpp - Server accept loop → TCP connection: accepts connections
chatRoom.cpp - Server accept loop → Client session: creates session
chatRoom.cpp - Client session → Chat room: joins room
chatRoom.cpp - Client session → Message framing: constructs message
chatRoom.cpp - Client session → Chat room: delivers message
chatRoom.cpp - Chat room → Client session: dispatches broadcast
chatRoom.cpp - Client session → Message framing: decodes body
chatRoom.cpp - Client session → TCP connection: reads and writes
chatRoom.cpp