Contents

SSLRead(_:_:_:_:)

Performs a normal application-level read operation.

Declaration

func SSLRead(_ context: SSLContext, _ data: UnsafeMutableRawPointer, _ dataLength: Int, _ processed: UnsafeMutablePointer<Int>) -> OSStatus

Parameters

  • context:

    An SSL session context reference.

  • data:

    On return, points to the data read. You must allocate this buffer before calling the function. The size of this buffer must be equal to or greater than the value in the dataLength parameter.

  • dataLength:

    The amount of data you would like to read.

  • processed:

    On return, points to the number of bytes actually read.

Mentioned in

Return Value

A result code. See Secure Transport Result Codes.

Discussion

The SSLRead(_:_:_:_:) function might call the SSLReadFunc function that you provide (see SSLSetIOFuncs(_:_:_:). Because you may configure the underlying connection to operate in a nonblocking manner, a read operation might return errSSLWouldBlock, indicating that less data than requested was actually transferred. In this case, you should repeat the call to SSLRead(_:_:_:_:) until some other result is returned.