This project is a simple networking chat application designed to strengthen my understanding of socket programming and real-time communication between systems. As a software engineer, I built this project to gain hands-on experience with network protocols, multi-client handling, and concurrent programming.
The application allows multiple users to connect to a central server and communicate with each other in real time. Users can send public messages, request a list of connected users, send private messages, and disconnect safely.
Open a terminal and run:
python server.py
Open one or more additional terminals and run:
python client.py
- Enter a username when prompted
- Start sending messages
/list→ Displays all connected users/msg username message→ Sends a private message/quit→ Disconnects from the server
The purpose of this software is to deepen my understanding of networking concepts, specifically how client-server systems communicate over TCP. It also helped me practice structuring multi-file programs, handling multiple users with threads, and designing simple communication protocols.
[Software Demo Video] https://youtu.be/OKjG7p8tUkk
This application uses a Client-Server Model. A central server manages all client connections and handles message routing. Clients connect to the server to send and receive messages.
- Protocol: TCP (Transmission Control Protocol)
- Port Number: 5555
- Host:
127.0.0.1(localhost for testing)
TCP is used to ensure reliable communication between the server and clients.
Messages are sent as plain text strings encoded in UTF-8.
Examples:
Public message:
Hello everyone
Private message:
/msg John Hello
Command:
/list
The server interprets messages that begin with / as commands and processes them accordingly.
- Visual Studio Code (code editor)
- Terminal / Command Prompt
- Python interpreter
- Language: Python 3
- Libraries:
socket→ for network communicationthreading→ for handling multiple clients simultaneously
- https://docs.python.org/3/library/socket.html
- https://realpython.com/python-sockets/
- https://www.geeksforgeeks.org/socket-programming-python/
- https://stackoverflow.com/
- Add a graphical user interface (GUI) using Tkinter
- Implement user authentication (login system)
- Save chat history to a file or database
- Improve error handling and reconnection support
- Add timestamps to messages