Function

SSLRead

Performs a normal application-level read operation.

Declaration

OSStatus SSLRead(SSLContextRef context, void *data, size_t dataLength, size_t *processed);

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.

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.

See Also

Read Operations

SSLGetBufferedReadSize

Determines how much data is available to be read.