Sample asynchronous protocol-based TCP client and server apps using C++ and Boost::Asio
sequenceDiagram
autonumber
participant client
participant server
client-->>server: connect
server->>client: welcome
client->>server: command
activate server
note right of server: execute
server->>client: output
deactivate server
client->>server: exit
server--xclient: disconnect
- C++11 or above
- Boost::Asio
- CMake
git clone --recursive git@github.com:iamazeem/TcpClientServerApp.git
cd TcpClientServerApp
cmake -S . -B build
cmake --build build
The client and server binaries will be generated under build
directory:
./build/server/server
./build/client/client
Run server
on one terminal:
./build/server/server
Run client
on another terminal:
./build/client/client