NetworkComm
TCP client server chat application demonstrating networking, protocol design, and concurrency.
Overview
NetworkComm is a Python-based TCP client server chat application built to demonstrate core networking, concurrency, and protocol-design concepts. It supports multiple clients connecting to a central server and exchanging messages in real time using socket programming and multithreading.
The project prioritises correctness, clarity, and real-world networking behaviour over UI complexity.
Server work
The server was originally developed collaboratively as part of a coursework project. I independently enhanced it with structured message logging, improved error handling for client disconnects, clearer message formatting, and more robust coordination between clients.
Client work
I implemented the client independently, including user interaction, server communication, retry logic when the server is unavailable, and asynchronous message reception using concurrent threads.
Key features
Real-time messaging features built on top of an explicit text-based protocol.
All communication is routed through the server to simplify coordination and maintain consistent state. Clients send and receive concurrently so user input does not block incoming messages.
Architecture
How the system coordinates multiple clients in real time.
The server listens on a specified host and port, while clients connect and register with a nickname. For each connected client, the server spawns a dedicated handler thread. Messages are routed through the server based on message type, including broadcast, private messages, or room-based messaging.
On the client side, sending and receiving are handled concurrently using separate threads to support an interactive experience without blocking on socket reads.
Tech stack
Tools and environment used to build the system.
Getting started
Running the server and connecting multiple clients.
Start the server using the command below, then run multiple client instances to simulate concurrent users.
Run server
python server.py
Run client
python mbylut003_client.py
When prompted, enter the server IP address and port. The default is 127.0.0.1 and 44444. Then provide a nickname and begin chatting.
Learning outcomes
What this project demonstrates.
This project strengthened my understanding of TCP/IP communication, concurrency using threads, and client server coordination. It also improved how I think about protocol design, synchronization, and real-world failure conditions such as disconnects, message framing, and ordering.
Limitations and scope
What is intentionally out of scope.
This project prioritizes conceptual correctness over production-grade security. Authentication, encryption, and fault tolerance are intentionally out of scope. Messages are transmitted in plain text and users are identified only by nickname.
Future enhancements
Planned improvements include explicit protocol framing for reliability, authentication and authorization, TLS support, persistence for chat history and room metadata, improved scalability through asynchronous I/O, configurable logging, and testing for protocol and concurrency behaviours.