---
title: "SSLWrite(_:_:_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/sslwrite(_:_:_:_:)"
---

# SSLWrite(_:_:_:_:)

Performs a typical application-level write operation.

## Declaration

```swift
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.

## Mentioned in

Using the Secure Socket Layer for Network Communication

## Return Value

Return Value A result code. See Secure Transport Result Codes.

## Discussion

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.
