This is a Python-based client-server communication application developed for CP372 (Computer Networks) at Wilfrid Laurier University. The application implements a basic chat system between multiple clients and a server using TCP sockets.
- Jillian Fernandes
- Ryan Campbell 169073812
- TCP socket-based client-server communication
- Support for multiple clients (up to 3 concurrent connections)
- Automatic client naming system (Client01, Client02, etc.)
- In-memory cache for tracking client connections
- Message acknowledgment system
- Status reporting functionality
- Clean client disconnection handling
- Bonus features:
- File repository listing
- File streaming capabilities
.
├── README.md
├── Server.py
├── Client.py
└── Report.pdf
If you're setting up the repository for the first time:
# Clone the repository
git clone https://github.com/souppman/cp372-a1.git
cd cp372-a1
# Configure your Git identity (if not already done)
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
# Add the remote repository
git remote add origin https://github.com/souppman/cp372-a1.git
Follow these steps when making changes:
# Get the latest changes
git pull origin main
# Make your changes to the files
# Check status of your changes
git status
# Add your changes
git add . # Add all changes
# OR
git add specific_file.py # Add specific file
# Commit your changes
git commit -m "Descriptive message about your changes"
# Push to repository
git push origin main
git status
: Check status of your changesgit pull
: Get latest changes from repositorygit add
: Stage changes for commitgit commit
: Save your changes locallygit push
: Upload your changes to repositorygit log
: View commit history
- Always pull before making changes
- Write clear commit messages
- Test code before pushing
- Start the server:
python server.py
- Start a client (in a separate terminal):
python client.py
- The server automatically handles client connections and maintains a connection cache
- Server limits connections to 3 concurrent clients
- Server responds to client messages with acknowledgments
- Messages are sent via command line interface
- Special commands:
status
: Request current server cache contentsexit
: Terminate connection with serverlist
: Request list of files in server repository (bonus feature)- To request a file: Enter the filename after receiving the file list
- Programming Language: Python
- Required Files:
- Server.py
- Client.py
- Report.pdf
- Demonstration is mandatory
- Both team members' names must be included in code files and report
- Server uses multi-threading to handle multiple clients
- Client naming follows the format "Client[XX]" (e.g., Client01, Client02)
- Cache maintains connection timestamps (start and end times)
- Clean disconnection handling implemented
Refer to the Report.pdf for:
- Test cases and screenshots
- Implementation details
- Challenges faced and solutions
- Potential improvements