(See the README.md file in the upper level 'examples' directory for more information about examples.)
The application creates UDP socket and sends message to the predefined port and IP address. After the server's reply, the application prints received reply as ASCII text, waits for 2 seconds and sends another message.
## How to use example
In order to create UDP server that communicates with UDP Client example, choose one of the following options.
Configure Wi-Fi or Ethernet under "Example Connection Configuration" menu. See "Establishing Wi-Fi or Ethernet Connection" section in [examples/protocols/README.md](../../README.md) for more details.
This example could be executed on host system, using lwIP port for linux and FreeRTOS simulator on linux. The socket API used in this example directly calls lwIP implementation. Follow the steps below to configure, build and run the example on linux operating system.
1. First configure the target (please note that using linux target is currently available only in `preview` stage)
```
idf.py --preview set-target linux
```
2. Configure the project
```
idf.py menuconfig
```
Choose connection capabilities in `Example Connection Configuration` menu:
* By default, the `example_connect()` function returns as a no-op, expecting that the connection is already available. This option is preferred when we don't have to interact with outside networking layers and use only lwIP internal interface, such as loopback netif (`lo`).
* If you want to connect lwIP network interface to the host system networking, set `EXAMPLE_CONNECT_LWIP_TAPIF`.
* Configure the interface address information (IP address, GW address and netmask).
* Create a host network interface named `tap0` of *TAP* type. You can use the `./make_tap_netif` script located in the `tapif_io` component directory.