> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_close.md).

# mariadb\_rpl\_close()

Closes a binary log stream and releases all resources associated with the replication handle.

### Syntax

```sql
#include <mariadb_rpl.h>

void mariadb_rpl_close(MARIADB_RPL *rpl);
```

### Parameters

<table><thead><tr><th width="374">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>rpl</code></td><td>A replication handle previously allocated by <a href="/pages/Mby08JGsfpSvwdQVoEjW">mariadb_rpl_init()</a> and and connected using <a href="/pages/MLcSftTOgFBY83fp07m9">mariadb_rpl_open()</a></td></tr></tbody></table>

### Notes

This function closes the replication stream and frees the `MARIADB_RPL` handle, but does **not** close the underlying database connection. To close the connection, call `mysql_close()` separately after `mariadb_rpl_close()`.

### History

Added in [MariaDB Connector/C 3.1.0](/docs/release-notes/connectors/c/3.1/3.1.0.md).

### See Also

* [mariadb\_rpl\_init()](/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_init.md)
* [mariadb\_rpl\_open()](/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_open.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_close.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
