This project is a simple client-server application implemented in C++. The server listens for incoming connections from clients and handles requests using multithreading. The communication protocol is based on custom-defined packets.
- Multithreaded server capable of handling multiple clients
- Custom packet protocol for communication
- CRC32 message verification
- Static linking of libraries
Before you start, make sure you have the following installed:
- C++ Compiler: GCC or Clang
- CMake: Version 3.10 or higher
- pthread: Typically included with the standard C library on Linux systems
You can install the necessary components using the following commands:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential cmake screen git
git clone https://github.com/analogdevicesinc/libiio.git --branch v0.26
cd libiio
mkdir build && cd build
cmake .. -DWITH_EXAMPLES=ON -DCPP_BINDINGS=ON
make CONFIG_IIO_SIMPLE_DUMMY_BUFFER=y
make install
git clone https://github.com/Ternick/client-server.git
cd client-server
cd src
mkdir build && cd build && cmake .. && make
sudo modprobe industrialio
sudo modprobe industrialio-configfs
sudo modprobe industrialio-sw-device
sudo modprobe industrialio-sw-trigger
sudo modprobe iio-trig-hrtimer
sudo modprobe iio_dummy
sudo mkdir /sys/kernel/config/iio/triggers/hrtimer/instance1
sudo mkdir /sys/kernel/config/iio/devices/dummy/iio_dummy_part_no
screen -S own_server
sudo ./server
sudo ./client
screen -r