Networking#
To open a network port for a device (both static or dynamic), each of the platform integration modules contains a similar API. For instance, when using libuv, the code could look like this:
using Device = decltype(device);
int main(int argc, char **argv)
{
// For static devices we must call init()
device.init();
libuv::tcp::port<aes70::port<Device>>
tcp(50001, "0.0.0.0", uv_default_loop(), device);
return uv_run(uv_default_loop(), UV_RUN_DEFAULT);
}
The code for lwIP or Boost.Asio would look similar. Please consult the examples for example code.