write(_:completionHandler:)
Write the data to the connection.
Declaration
func write(_ data: Data, completionHandler completion: @escaping ((any Error)?) -> Void)Parameters
- data:
The data object whose content will be written.
- completion:
The completion handler to be invoked when the data content has been written or an error has occurred. If
errorisnil, the write succeeded and the caller can write more data.
Discussion
Callers should wait until the completionHandler is executed before issuing another write.