| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A complete implementation of Client-Server Communication using Python's built-in socket library — covering both TCP and UDP protocols with real-time bidirectional messaging.
This project demonstrates real-time Client-Server Communication using Python sockets. It implements both TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) with features like timestamps, uppercase conversion, message counting, and graceful exit handling.
Socket-Programming-Python/ │ ├── tcp_server.py # TCP Server Program ├── tcp_client.py # TCP Client Program ├── udp_server.py # UDP Server Program ├── udp_client.py # UDP Client Program └── README.md # Project Documentation
| Feature | TCP | UDP |
|---|---|---|
| Connection | Required | Not Required |
| Reliability | High ✅ | Low ⚠️ |
| Speed | Slower | Faster ⚡ |
| Data Order | Guaranteed | Not Guaranteed |
| Port Used | 12345 | 12346 |
| Real-world Use | HTTP, FTP, Email | Streaming, Gaming, DNS |
python --version # Make sure Python 3.x is installedOpen two terminals simultaneously:
# Terminal 1 — Run Server FIRST
python tcp_server.py
# Terminal 2 — Run Client SECOND
python tcp_client.py# Terminal 1 — Run Server FIRST
python udp_server.py
# Terminal 2 — Run Client SECOND
python udp_client.py⚠️ Always start the Server before the Client!
========================================
UDP SERVER STARTED
Student : Niha Hawas
========================================
Listening on 127.0.0.1:12346 ...
Waiting for messages...
[20:24:28] Client [1]: HELLO
└ UPPERCASE: [NIHA HAWAS | 2312274] CLIENT: HELLO
Your Reply: HI
[20:24:46] Client [2]: HAVE YOU DONE YOUR TASK
└ UPPERCASE: CLIENT: HAVE YOU DONE YOUR TASK
Your Reply: YES IT IS DONE
✅ UDP Server closed. Total messages handled: 7
| # | Task | Status |
|---|---|---|
| 1 | TCP Server and Client communication | ✅ |
| 2 | UDP Server and Client communication | ✅ |
| 3 | Exchange at least 5 messages | ✅ (7 messages) |
| 4 | Send Student Name and Registration Number | ✅ |
| ⭐ | Timestamps on every message | ✅ |
| ⭐ | Convert messages to UPPERCASE | ✅ |
| ⭐ | Terminate session with exit command | ✅ |
| Tool | Purpose |
|---|---|
| Python 3.x | Core Language |
| socket module | Network Communication |
| VS Code | Development Environment |
| GitHub | Version Control |
|
Niha Hawas |
This project is licensed under the MIT License — feel free to use and modify.
Made with ❤️ by Niha Hawas
| Back | FazBrowse Home | New Git URL |