---
title: "SSLGetDatagramWriteSize(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/sslgetdatagramwritesize(_:_:)"
---

# SSLGetDatagramWriteSize(_:_:)

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

## Declaration

```swift
func SSLGetDatagramWriteSize(_ dtlsContext: SSLContext, _ bufSize: UnsafeMutablePointer<Int>) -> OSStatus
```

## Parameters

- `dtlsContext`: The SSL context associated with the connection.
- `bufSize`: The address of a size_t integer for storing the length.

## Return Value

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

## Discussion

Discussion Although any packet below this threshold size will not be fragmented by the OS when sent using SSLWrite(_:_:_:_:), this function provides no guarantees about whether the packet will be fragmented by routers en route. This size value is equal to the maximum Datagram Record size (set by calling SSLSetMaxDatagramRecordSize(_:_:)) minus the DTLS Record header size.
