Distributed Chat Application
A Multi-Client, Thread-Safe Messaging System
Team Members:
Rajan Patel - Student Id: 202251093
Karan Acharya - Student Id: 202251064
Prakhar Jain - Student Id: 202251099
CS401 - Introduction to Distributed and Parallel Computing
Distributed Chat App
Problem Description
Core objective: Design and implement a distributed chat application enabling simultaneous multi-client connections through a
centralized server architecture
Technical challenges:
Handle concurrent connections
Route communications efficiently
Maintain thread-safe operations
Support both broadcast and point-to-point messaging
Requirements:
Multi-client support with unique usernames
Public chat (broadcast messaging)
Private chat (one-to-one communication)
File transfer capabilities (both public and private)
Distributed Chat App
Methods & Implementation
Technology Stack
Python 3: Primary development language
Socket Library: TCP/IP communication
Threading: Concurrent execution management
Tkinter GUI: Client-side interface
System Architecture
Server Client
Binds to [Link], spawns thread per client, thread-safe client Connects to server IP, Tkinter GUI, background thread for
management receiving
Code Highlights
Protocol headers: CHAT:, PRIVATE_CHAT:, FILE_START:, PRIVATE_FILE_START:
Thread-safe operations using [Link]
Queue-based message passing between threads
Distributed Chat App
Results
Multi-Client Success Communication File Transfer
3 concurrent clients connected Testing Verification
simultaneously Public messages successfully Public file transfer: desired file
100% connection reliability broadcast to all clients transmitted to all clients
Connected users: rajan, prakhar, Private messages delivered only to Private file transfer: delivered
karan intended recipients exclusively from Karan to Rajan
GUI properly distinguishes message
types
The system successfully handled multiple simultaneous connections, ensuring reliable communication and distinguishing between
public broadcasts and private messages.
Distributed Chat App
Conclusion
Project Success Summary
Successfully developed a production-ready, thread-safe distributed chat application
Met all requirements for public/private messaging and file transfers
Robust concurrent client handling achieved
Key Learnings
TCP/IP networking mastery with Python sockets
Multithreading architecture for concurrent connections
Thread-safe design using synchronization primitives
Inter-thread communication with queue-based messaging
Future Enhancements
End-to-end encryption for private messages
Dynamic user list with join/leave notifications
Multi-room support for organized discussions
Distributed Chat App