Instance Method

write:completionHandler:

Write the data to the connection.

Declaration

- (void)write:(NSData *)data completionHandler:(void (^)(NSError *error))completion;

Parameters

data

The data object whose content will be written.

completionHandler

The completion handler to be invoked when the data content has been written or an error has occurred. If error is nil, the write succeeded and the caller can write more data.

Discussion

Callers should wait until the completionHandler is executed before issuing another write.

See Also

Transferring Data

- readLength:completionHandler:

Read a certain number of bytes on a connection

- writeClose

Close the connection for writing