A client-server application for managing event reservations, implemented in C++ using raw POSIX sockets. Developed as a Computer Networks course project.
The system uses UDP for lightweight operations (login, logout, listing) and TCP for operations involving larger payloads (creating events with file attachments, reservations, viewing event details).
client/ → user CLI (user.cpp, commands.cpp)
server/ → Event Server (es.cpp)
common/ → shared utilities (common.cpp, constants.hpp)
| Command | Protocol | Description |
|---|---|---|
login <uid> <pass> |
UDP | Log in or register a new user |
logout |
UDP | Log out of the current session |
unregister |
UDP | Delete user account |
list |
TCP | List all available events |
myevents / mye |
UDP | List events created by the logged-in user |
myreservations / myr |
UDP | List reservations made by the logged-in user |
create <name> <file> <date> <time> <seats> |
TCP | Create a new event with a file attachment |
reserve <eid> <seats> |
TCP | Reserve seats for an event |
show <eid> |
TCP | Show event details and download its file |
close <eid> |
TCP | Close an event (owner only) |
changePass <old> <new> |
TCP | Change account password |
exit |
— | Exit the client (must be logged out first) |
- Linux
- g++ with C++17 support
makeThis produces two executables: ES (server) and user (client).
1. Start the server:
./ES [-p ESport] [-v]-p ESport— port to listen on (default:58016)-v— verbose mode
2. Start the client:
./user [-n ESIP] [-p ESport]-n ESIP— IP address of the server (default:localhost)-p ESport— server port (default:58016)
Example session:
> login 000001 mypasswd
new user registered
> create SummerFest poster.pdf 25-07-2026 20:00 200
the event was successfully created, EID = 1
> list
1 SummerFest 1: Accepting reservations 25-07-2026 20:00
> reserve 1 2
accepted
> myreservations
1 25-07-2026 20:00 2
> logout
successful logout
make clean