Welcome to Socket Programming in Python. This repository demonstrates client-server communication using TCP protocol, with both single-connection (Version 1.0) and multi-threaded concurrent connections (Version 2.0) implementations. The project supports both normal users for surveys and admin users for server monitoring.
- Admin Panel: Root user authentication to view survey data.
- Survey System: Clients can submit surveys.
- Single Connection: Only one client can connect to the server at a time.
- Real-Time Data Transfer: Logs and displays survey data in real-time for the admin.
- Admin Panel: Allows root users to log in and view the survey data as well as live and total visited connections.
- Multi-Threading: Supports multiple concurrent client connections.
- Survey System: Similar survey mechanism as Version 1.0 with enhanced functionality.
- Security: Admin credentials are handled more securely.
Socket-Programming/
│
├── TCP/
│ ├── Version 1.0/
│ │ ├── admin.py # Single connection admin panel
│ │ ├── client.py # Client program for survey
│ │ ├── server.py # Server for handling single connection
│ │ ├── helper.py # Helper functions for credentials and data handling
│ │ └── survey_data.csv # Stored survey data
│
│ ├── Version 2.0/
│ │ ├── admin.py # Multi-threaded admin panel
│ │ ├── client.py # Client program for survey
│ │ ├── server.py # Server for handling multiple concurrent connections
│ │ ├── helper.py # Helper functions for credentials and session handling
│ │ └── survey_data.csv # Stored survey data
- Python 3.x
- PrettyTable
git clone https://github.com/Satish-Kumar-Verma/Socket-Programming.git
cd Socket-Programming - TCP/
pip install -r requirements.txt # Install PrettyTable if not already installed
-
Start the server:
python Version\ 1.0/server.py
-
Run the client to perform a survey:
python Version\ 1.0/client.py
-
Admin can view the results by running the admin panel:
python Version\ 1.0/admin.py
-
Start the server:
python Version\ 2.0/server.py
-
Run multiple clients to perform surveys:
python Version\ 2.0/client.py
-
Admin can log in and view the results using the admin panel:
python Version\ 2.0/admin.py
Both versions use a client-server architecture. In Version 1.0, only one client can connect to the server at a time, whereas Version 2.0 supports multiple clients simultaneously using threads. Admin authentication allows the server admin to view and manage survey data.
We welcome contributions! Feel free to submit issues, bug reports, or feature requests. If you'd like to contribute code, please:
- Fork the repository.
- Create a new feature branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -am 'Add a new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or support, open an issue or contact me at hlaminnaing013@gmail.com.
Happy coding! 😊