Function

SSLWrite(_:_:_:_:)

Performs a typical application-level write operation.

Declaration

func SSLWrite(_ context: SSLContext, _ data: UnsafeRawPointer?, _ dataLength: Int, _ processed: UnsafeMutablePointer<Int>) -> OSStatus

Parameters

context

An SSL session context reference.

data

A pointer to the buffer of data to write.

dataLength

The amount, in bytes, of data to write.

processed

On return, the length, in bytes, of the data actually written.

Return Value

A result code. See Secure Transport Result Codes.

Discussion

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

See Also

Write Operations

func SSLGetDatagramWriteSize(SSLContext, UnsafeMutablePointer<Int>) -> OSStatus

Provides the largest packet that the OS guarantees it can send without fragmentation.

Deprecated
func SSLGetMaxDatagramRecordSize(SSLContext, UnsafeMutablePointer<Int>) -> OSStatus

Obtains the maximum datagram record size allowed by the application for a given context.

Deprecated
func SSLSetMaxDatagramRecordSize(SSLContext, Int) -> OSStatus

Sets the maximum datagram record size allowed by the application for a given context.

Deprecated
func SSLSetDatagramHelloCookie(SSLContext, UnsafeRawPointer?, Int) -> OSStatus

Sets the cookie value used in the Datagram Transport Layer Security (DTLS) hello message.

Deprecated