# otUdpSocket Struct Reference

# otUdpSocket


`#include <openthread/udp.h>`

Represents a UDP socket.

## Summary

| ### Public attributes ||
|---|---|
| `https://openthread.io/reference/struct/ot-udp-socket#structot_udp_socket_1a1988824d212b26a9b3f9cb5d412121a5` | `void *` A pointer to application-specific context. |
| `https://openthread.io/reference/struct/ot-udp-socket#structot_udp_socket_1ac0179b3bc55f4e14f5a5a5c7af22076e` | `void *` A handle to platform's UDP. |
| `https://openthread.io/reference/struct/ot-udp-socket#structot_udp_socket_1aa2ecdf82a3d6a9b21e301314de2271f0` | `https://openthread.io/reference/group/api-udp#group__api-udp_1ga2f9fe48646b31d5088d9c4e2492fe9ce` A function pointer to the application callback. |
| `https://openthread.io/reference/struct/ot-udp-socket#structot_udp_socket_1a6b032ae6962bba7bd422f09fc43e669d` | `https://openthread.io/reference/group/api-udp#group__api-udp_1gae0373a8b42c58d633bd4d0b23199a678` The network interface identifier. |
| `https://openthread.io/reference/struct/ot-udp-socket#structot_udp_socket_1af59a47912e318de493cb93710638e25d` | `struct https://openthread.io/reference/struct/ot-udp-socket *` A pointer to the next UDP socket (internal use only). |
| `https://openthread.io/reference/struct/ot-udp-socket#structot_udp_socket_1aa853c7bac2584475eeee492aaad610ca` | `https://openthread.io/reference/struct/ot-sock-addr` The peer IPv6 socket address. |
| `https://openthread.io/reference/struct/ot-udp-socket#structot_udp_socket_1a4a99b2565fbe000fc93add20178374bd` | `https://openthread.io/reference/struct/ot-sock-addr` The local IPv6 socket address. |

## Public attributes

### mContext

```
void * otUdpSocket::mContext
```
A pointer to application-specific context.

### mHandle

```
void * otUdpSocket::mHandle
```
A handle to platform's UDP.

### mHandler

```
otUdpReceive otUdpSocket::mHandler
```
A function pointer to the application callback.

### mNetifId

```
otNetifIdentifier otUdpSocket::mNetifId
```
The network interface identifier.

### mNext

```
struct otUdpSocket * otUdpSocket::mNext
```
A pointer to the next UDP socket (internal use only).

### mPeerName

```
otSockAddr otUdpSocket::mPeerName
```
The peer IPv6 socket address.

### mSockName

```
otSockAddr otUdpSocket::mSockName
```
The local IPv6 socket address.

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).