readLength(_:completionHandler:)
Read a certain number of bytes on a connection.
Declaration
func readLength(_ length: Int, completionHandler completion: @escaping (Data?, (any Error)?) -> Void)Parameters
- length:
The exact number of bytes the caller wants to read.
- completion:
The completion handler to be invoked when data has been read or an error occurred.
Discussion
Read length number of bytes. See readMinimumLength:maximumLength:completionHandler: for a complete discussion of the callback behavior.