Auction Socket is a client–server based auction management system built using
Python socket programming and MySQL.
It simulates a simplified IPL-style player auction, where multiple clients can
connect to a central server and interact with auction-related functionalities.
The system demonstrates network programming, concurrency, and database integration in a real-time environment.
The project follows a TCP client–server architecture:
- The server manages auction logic and communicates with a MySQL database
- The client connects to the server and interacts via menu-driven options
- Multiple clients can connect simultaneously using threading
- TCP socket-based communication
- Multi-client handling using Python threads
- Menu-driven auction interaction
- MySQL database integration for persistent data
- Fetches and displays remaining (unsold) players
- Graceful client exit handling
Client (Python Socket)
⇅ TCP Connection
Server (Python Socket + Threads)
⇅
MySQL Database (Players Data)
| Layer | Technology |
|---|---|
| Language | Python |
| Networking | Socket Programming (TCP) |
| Concurrency | threading |
| Database | MySQL |
| Database Driver | mysql-connector-python |
- Client connects to the server on a specified port
- Server sends a welcome message and menu options
- Client selects an option from the menu
- Server processes the request and responds accordingly
- Database queries are executed when required
- Client receives and displays the response
1. Buy Player
2. Check the remaining players
3. Check the team players
4. Exit
Note: Some options (such as buying players and viewing team players) are placeholders for future enhancements.
The project assumes a MySQL database named players with a table structured similar to:
CREATE TABLE players (
player_name VARCHAR(100),
nationality VARCHAR(50),
role VARCHAR(50),
price INT
);- Players with
price = NULLare considered unsold - These players are returned when checking remaining players
- Python 3.8 or higher
- MySQL Server
mysql-connector-pythonpackage
Install the required Python package:
pip install mysql-connector-pythonUpdate the database credentials in the server code:
connection = mysql.connector.connect(
host='localhost',
user='your_username',
password='your_password',
database='players'
)Ensure the database is running before starting the server.
python server.pyThe server will listen on:
localhost:8888
In a separate terminal:
python client.pyYou can start multiple clients in different terminals to test concurrency.
Welcome to the IPL AUCTION.
Choose one of the below options:
1. Buy Player.
2. Check the remaining players.
3. Check the team players.
4. Exit!
- Handles invalid menu input
- Gracefully closes client connections
- Catches database connection and query errors
- Buying players and team management logic are not fully implemented
- Authentication is not included
- No encryption (plain TCP sockets)
- Implement player bidding and team assignment
- Add authentication and authorization
- Improve concurrency control
- Introduce logging and monitoring
- Secure communication using SSL/TLS
- Refactor into modular services
This project demonstrates:
- Socket-based network programming
- Client–server architecture
- Multi-threaded server design
- Database-backed application logic
- Real-time interaction between distributed components
This project is provided for educational purposes.