Skip to content

Commit a3c0360

Browse files
author
Amanda Butler
authored
Merge pull request #296 from deepikabhavnani/udp_socket
UDP sockect doc update
2 parents 4e75647 + b066ab6 commit a3c0360

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/reference/api/connectivity/networksocket/UDPSocket.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
The UDPSocket class provides the ability to send packets of data over UDP, using the `sendto` and `recvfrom` member functions. Packets can be lost or arrive out of order, so we suggest using a [TCPSocket](/docs/v5.6/reference/tcpsocket.html) when you require guaranteed delivery.
44

5+
The constructor takes in the NetworkStack pointer to open the socket on the specified NetworkInterface. If you do not pass in the constructor, then you must call `open` to initialize the socket.
6+
57
### UDPSocket class reference
68

79
[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/v5.6/mbed-os-api-doxy/class_u_d_p_socket.html)
10+
11+
### UDPSocket Example
12+
13+
Here is a UDP example to read the current UTC time by sending a request to the NIST Internet Time Service.
14+
15+
[![View code](https://www.mbed.com/embed/?url=https://os.mbed.com/teams/mbed_example/code/mbed-os-example-udp-sockets)](https://os.mbed.com/teams/mbed_example/code/mbed-os-example-udp-sockets/file/cf516d904427/main.cpp)

0 commit comments

Comments
 (0)