generated from administrator/template_project
implement test server
This commit is contained in:
@@ -15,7 +15,8 @@ make
|
||||
|
||||
- **C++ Standard**: C++11 (enforced)
|
||||
- **Build System**: CMake (generates `compile_commands.json` automatically)
|
||||
- **Build Directory**: `/build` (ignored in git)
|
||||
- **Build Directory**: `build/` (ignored in git)
|
||||
- **PIP Library**: Installed at `/usr/local/include/pip`
|
||||
- **Entrypoint**: `src/main.cpp`
|
||||
|
||||
## Dependencies
|
||||
@@ -42,10 +43,24 @@ clang-format -i src/*.cpp src/*.h
|
||||
|
||||
The server creates a `PIKbdListener` that:
|
||||
- Captures F10 key press for graceful exit
|
||||
- Starts an HTTP server (address printed on startup)
|
||||
- Starts an HTTP server on `0.0.0.0:8888`
|
||||
- Waits for exit signal via `WAIT_FOR_EXIT` macro
|
||||
|
||||
## API Endpoints
|
||||
|
||||
| Endpoint | Method | Description |
|
||||
|----------|--------|-------------|
|
||||
| `/api/connect` | GET | Connects TCP client to 127.0.0.1:1234 |
|
||||
| `/api/disconnect` | GET | Disconnects TCP client |
|
||||
|
||||
## Testing
|
||||
|
||||
Use `reproduce_crash.sh` to test the TCP connect/disconnect functionality:
|
||||
```bash
|
||||
./reproduce_crash.sh
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Qt Creator is the primary IDE (`.qtcreator/` config present)
|
||||
- No tests or CI configured
|
||||
- No unit tests or CI configured
|
||||
|
||||
Reference in New Issue
Block a user