Instance Method

writeDatagram(_:completionHandler:)

Write a single datagram

Declaration

func writeDatagram(_ datagram: Data, completionHandler: @escaping (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.

See Also

Transferring Data

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software