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