writeDatagram(_:completionHandler:)
Write a single datagram.
Declaration
func writeDatagram(_ datagram: Data, completionHandler: @escaping ((any Error)?) -> Void)Parameters
- datagram:
An Nsdata object containing the datagram to write. To improve performance, this should be an immutable data object.
- completionHandler:
A handler called when the write request has either succeeded or failed.
Discussion
Callers should wait until the completionHandler is executed before issuing another write.