Test application including a TCP client and server. Implemented for various programming languages, operating systems and IDEs. Applications can generally be configured to run server or client only.
The demo uses the spdlog
dependency. Run the following command first
git submodule init
git submodule update
The demo is located inside the tcpip-cpp
folder and
can be configured by editing the demo_config.h
file in the build directory after
generating the build system with CMake
.
Project template for building C++ and C projects with CMake and various different compilers and IDEs. Install CMake first.
All builds displayed here are for Debug configurations. To build for release, replace
Debug
with Release
in the folder names and and add -DCMAKE_BUILD_TYPE=Release
to the CMake build command.
Install MSYS2 first. All command line steps here were done in MinGW64. Set up MinGW64:
pacman -Syuuu
pacman -S git mingw-w64-x86_64-gdb mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc
Then build the application with
cd tcpip-cpp
mkdir build-Debug-MinGW64 && cd build-Debug-MinGW64
cmake -G "MinGW Makefiles" ..
cmake --build . -j
Make sure you can build the application with MinGW64 like specified above. After that there are good instructions on how to set up Visual Studio Code here. A workspace file is provided as well to get started quickly.
Copy the .project
and .cproject
file found in misc/eclipse
into the project root
and open the folder in Eclipse with Open Project from Filesystem
. Build configurations and
launch files for MinGW were provided. You have to generate the build system with CMake via
command line first before you can Build, Run and Debug with Eclipse.
Install Visual Studio. You can generate Visual Studio project files with the following command (here, for Visual Studio 2019)
cd tcpip-cpp
mkdir build-Debug-VS2019 && cd build-Debug-VS2019
cmake .. -G "Visual Studio 16 2019"
After that, a .sln
project file is generated which you can open with Visual Studio 2019.
Instructions can be found here. Not tested yet.
Coming soon.
Instructions for Ubuntu, adapt accordingly Install required packages and tools first
sudo apt-get update
sudo apt-get install build-essential gdb
Build the project like this:
cd tcpip-cpp
mkdir build-Debug-Unix && cd build-Debug-Unix
cmake ..
cmake --build . -j
Copy the .project
and .cproject
file found in misc/eclipse
into the project root
and open the folder in Eclipse with Open Project from Filesystem
. Build configurations and
launch files for Unix systems were provided. You have to generate the build system with CMake via
command line first before you can Build, Run and Debug with Eclipse.
Make sure you can build the application like specified above. After that there are good instructions on how to set up Visual Studio Code here
Coming soon.
The demo is located inside the tcpip-c
folder.It can be configured like the C++ demo
by editing the demo_config.h
file in the build folder after build system generation with CMake
.
Perform the same preparation steps as specified in the C++ chapter for MinGW Makefiles, then build the application with
cd tcpip-c
mkdir build-Debug-MinGW64 && cd build-Debug-MinGW64
cmake -G "MinGW Makefiles" ..
cmake --build . -j
Perform the preparation steps as specified above for Unix Makefiles, then build the application with
cd tcpip-c
mkdir build-Debug-Unix && cd build-Debug-Unix
cmake ..
cmake --build . -j
If Gradle is installed, you can run the demo with the command
./gradlew run
If you are using Eclipse, it is recommended to install the JDT and the Eclipse Buildship Gradle Integration.
The demo can be configured via config.py
file.
You can run the demo by executing the main.py
file. Replaced python3
with py
on Windows.
python3 main.py