NWUDPSession
An object to manage a UDP session to a network endpoint.
Declaration
class NWUDPSessionOverview
Since UDP does not include a handshake with the remote endpoint as part of its protocol, it is up to the client of the UDP session to provide feedback on the viability of the current endpoint. If a session is opened to a hostname, the system will resolve that hostname into potentially several IP addresses. Once the session state is NWUDPSessionStateReady, the client should try to write and read datagrams. If there is no response from the remote endpoint, the client can try the next address that was resolved using tryNextResolvedEndpoint.
Topics
Monitoring the session state
Selecting remote endpoints
Transferring data
setReadHandler(_:maxDatagrams:)writeDatagram(_:completionHandler:)writeMultipleDatagrams(_:completionHandler:)maximumDatagramLength