PC Control is a modular C++ server application that listens for client commands and performs system actions. It demonstrates core C++ design concepts like modular programming, command parsing, socket communication, and logging — suitable as a prototype for showcasing my C++ learning.
COMMAND|PARAMETER
Example:
LAUNCH|Chrome
LAUNCH|App
open_chrome
EXIT
OK|Application Launched: Chrome
ERROR|Unknown Command
ERROR|Invalid Format
OK|Good Bye
| Module | Purpose |
|---|---|
| Server | Manages TCP socket connection, accepts client requests, and coordinates command processing |
| Command | Defines a Command class to represent parsed requests (command name and parameter) |
| CommandParser | Parses raw client input strings into Command objects for structured handling |
| ActionHandler | Determines which action to execute based on the command type (e.g., LAUNCH, EXIT) |
| LaunchAppAction | Executes system-level commands to open applications like Chrome or VS Code |
| ResponseGenerator | Formats clean, consistent responses (e.g., “OK |
| LoggingSystem | Records executed actions, responses, and errors with timestamps |
| Main | Entry point that initializes and runs the server indefinitely |
- Client sends →
LAUNCH|chrome - Server receives the request and forwards it to
CommandParser - CommandParser converts it into a
Command("LAUNCH", "chrome")object - ActionHandler triggers
LaunchAppAction - ResponseGenerator returns →
OK|Launching Chrome - LoggingSystem records →
[INFO] Launched Chrome - Server sends the response back to the client
PC-Control/
│
├── Server/
│ ├── inc/
│ │ └── Server.hpp
│ └── src/
│ └── Server.cpp
│
├── Command/
│ ├── inc/
│ │ ├── Command.hpp
│ │ └── CommandParser.hpp
│ └── src/
│ └── CommandParser.cpp
│
├── ActionHandler/
│ ├── inc/
│ │ ├── Action.hpp
│ │ ├── ActionHandler.hpp
│ │ └── ActionResult.hpp
│ └── src/
│ ├── ActionHandler.cpp
│ └── LaunchAppAction.cpp
│
├── ResponseGenerator/
│ ├── inc/
│ │ └── ResponseGenerator.hpp
│ └── src/
│ └── ResponseGenerator.cpp
│
├── Logging/
│ ├── inc/
│ │ ├── LogEntry.hpp
│ │ └── LoggingSystem.hpp
│ └── src/
│ └── LoggingSystem.cpp
│
└── main.cpp
- Add authentication or token validation
- Allow multiple simultaneous clients (multi-threading)
- Add GUI or web client for sending commands
- Expand supported commands (shutdown, restart, etc.)
- Save logs to a file instead of memory
This project represents a complete end-to-end C++ system that:
- Uses modular, maintainable design
- Demonstrates socket programming, command parsing, and process execution
- Includes logging and clean response handling
It’s perfect as a learning showcase or prototype demo for system-level C++ control applications.
