---
title: "es_retain_message(_:)"
framework: endpointsecurity
role: symbol
role_heading: Function
path: "endpointsecurity/es_retain_message(_:)"
---

# es_retain_message(_:)

Retains the given message, extending its lifetime until released.

## Declaration

```swift
func es_retain_message(_ msg: UnsafePointer<es_message_t>)
```

## Parameters

- `msg`: The message to retain.

## Discussion

Discussion If you asynchronously process the message provided to the event-handler block of es_new_client(_:_:), you must retain the message.

## See Also

### Retaining and Releasing Messages

- [es_release_message(_:)](endpointsecurity/es_release_message(_:).md)
