.. _cpp2ethernet: cpp2ethernet - Ethernet Abstractions ==================================== Overview -------- ``cpp2ethernet`` provides functionality to send and receive data through sockets. Also it contains features that help in managing network interfaces. This module contains following features: * API for UDP and TCP socket handling * Wrapper for IP addresses * Registry for network interface handling This module has the following dependencies: * :ref:`platform` * :ref:`util` * common Public API ---------- UDP +++ AbstractDatagramSocket ~~~~~~~~~~~~~~~~~~~~~~ The ``AbstractDatagramSocket`` is used to setup a UDP connection, reading data and sending data. - **Receive**: An application that is using an ``AbstractDatagramSocket`` and wants to receive UDP data shall implement the ``IDataListener`` interface. Additionally, ``setDataListener()`` has to be set with the implemented ``IDataListener`` object. Also a connection has to be properly set up by calling ``bind()`` or ``connect()``. Once the UDP data is received, the ``dataReceived()`` function will be called. The application is then responsible to read the data with ``read()``. It is also possible to receive multicasts by joining a multicast group with ``join()``. - **Send**: In order to send UDP data, there are two options. #. ``connect()`` and ``send(slice