LIBWIRE
Next-generation C++17 networking library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
echo_server.cpp

This example shows how to implement TCP echo server using libwire::tcp::listener and libwire::tcp::socket classes.Example code is pretty simple to understand but let's describe each step in detail if you are in doubt:

  1. listener.listen(ipv4::any, port);
    Here we start listening on any IPv4-capable interface using specified port.
  2. Then we enter infinite loop, accept connection, echo received bytes until any error and continue with next connection.