This repository contains cross platform C++ classes and example code for using sockets on Linux and Windows. Examples are in the /example directory
It's using cmake, so you have to look up how to use it for your toolset as there is too much variation to list them all
mkdir build
cd build
cmake ..
make