---
name: "memcached_quit"
section: "3"
platform: "linux"
package: "libmemcached-awesome"
version: "1.1.4-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/memcached_quit"
---

# memcached\_quit(3)

libmemcached Documentation

## NAME

memcached\_quit - libmemcached Documentation

## SYNOPSIS

- **#include \<libmemcached/memcached.h\>**

  Compile and link with -lmemcached

- **void memcached\_quit(memcached\_st \<#\_CPPv412memcached\_st\> \*ptr)**

  - **Parameters**

    **ptr** -- pointer to initialized **memcached\_st** \<#\_CPPv412memcached\_st\> struct

## DESCRIPTION

**memcached\_quit()** will disconnect you from all currently connected servers. It will also reset the state of the connection (i.e., any **memcached\_fetch()** \<#\_CPPv415memcached\_fetchP12memcached\_stPcP6size\_tP6size\_tP8uint32\_tP18memcached\_return\_t\> you are in the middle of will be terminated). This function is called automatically when you call **memcached\_free()** \<#\_CPPv414memcached\_freeP12memcached\_st\> on the **memcached\_st** \<#\_CPPv412memcached\_st\> structure.

You do not need to call this on your own. All operations to change server hashes and parameters will handle connections to the server for you. This function is provided mainly so that you can timeout your connections or reset connections during the middle of a **memcached\_fetch()** \<#\_CPPv415memcached\_fetchP12memcached\_stPcP6size\_tP6size\_tP8uint32\_tP18memcached\_return\_t\>.

## RETURN VALUE

A value of type **memcached\_return\_t** \<#\_CPPv418memcached\_return\_t\> is returned On success that value will be **MEMCACHED\_SUCCESS** \<#\_CPPv4N18memcached\_return\_t17MEMCACHED\_SUCCESSE\>.  Use **memcached\_strerror()** \<#\_CPPv418memcached\_strerrorP12memcached\_st18memcached\_return\_t\> to translate this value to a printable string.

## SEE ALSO

**[memcached(1)](/memcached/1.md) \<https://linux.die.net/man/1/memcached\>** **[libmemcached(3)](/libmemcached/3.md) \<https://linux.die.net/man/3/libmemcached\>** **[memcached\_strerror(3)](/memcached_strerror/3.md) \<https://linux.die.net/man/3/memcached\_strerror\>**
