Create a UDP session.
- iOS 9.0+
- macOS 10.11+
The remote endpoint to send UDP datagrams to.
The local endpoint to bind the UDP session to. If nil, the UDP session will be bound to an ephemeral port on the primary physical interface.
NWUDPSession object. The remote endpoint is in the process of being resolved. You can observe the session’s
state property using KVO to determine when the session can be used to send and receive UDP datagrams.
This method provides a convenient way to create UDP connections from a Network Extension Provider. It is preferred over using the sockets API. For instance, the Tunnel Provider can use this method to create a UDP connection with the tunnel server that can be used to tunnel network data.