MEMCACHED_SERVER_LIST_COUNT(3)
π MEMCACHED_SERVER_LIST_COUNT π
okay bestie, welcome to libmemcached-awesome β this page is MEMCACHED_S...R_LIST_COUNT(3) and it's all about the lil list of servers you're talking to. let's get into it π«Ά
β¨ NAME β¨
memcached_server_list_count β libmemcached Documentation
like, that's the whole name, that's the whole vibe. π
πΈ SYNOPSIS πΈ
#include <libmemcached/memcached.h>
and bestie you gotta Compile and link with -lmemcached or none of this works, fr fr.
typedef struct memcached_instance_st memcached_instance_st
typedef struct memcached_server_st memcached_server_st
typedef struct memcached_server_st *memcached_server_list_st
okay and then the actual functions π
void memcached_server_list_free(memcached_server_list_st list)
- list β an instance of an initialized
memcached_server_list_stobject
memcached_server_list_st
memcached_server_list_append(memcached_server_list_st list, const char
*hostname, in_port_t port, memcached_return_t *error)
- list β an instance of an existing
memcached_server_list_st, ornullptrif you wanna create a fresh one π£ - hostname β the hostname or path to the socket; if it's null it defaults to
localhost - port β the port to use; if it's
0it defaults to11211 - error β pointer to store any
memcached_return_terror, and it'll tell you if it succeeded
Returns β a new instance of memcached_server_list_st if it worked, or nullptr if it flopped π
uint32_t memcached_server_list_count(memcached_server_list_st list)
- list β instance of
memcached_server_list_st
Returns β the count of servers in the list. that's it. that's the whole function. iconic. π
const char *memcached_server_error(const memcached_instance_st
*instance)
- instance β pointer to an initialized
memcached_instance_stobject
Returns β the last error message sent from the server to the client π©
void memcached_server_error_reset(const memcached_instance_st *list)
Deprecated since version 0.39. bestie she's retired, do not use her π
void memcached_servers_parse()
Deprecated since version 0.39. See memcached().
π¦ DESCRIPTION π¦
so libmemcached operates on a list of hosts which are stored in memcached_server_st structures. and listen β you should not modify these structures directly. nope. hands off. Functions are provided to modify these structures, so use those instead, okay? π
memcached_server_list() is used to provide an array of all defined hosts. fun lil historical note: this was incorrectly documented as "requiring free" up till version 0.39. so if you saw that somewhere, no you didn't. π
memcached_server_list_free() deallocates all memory associated with the array of memcached_server_st that you passed to it. clean up after yourself, bestie π§Ή
memcached_server_list_append() adds a server to the end of a memcached_server_st array. On error null will be returned and the memcached_return_t pointer you passed into the function will be set with the appropriate error. If the value of port is zero, it is set to the default port of a memcached server. β¨
DEPRECATED: memcached_servers_parse(), please see memcached() π
memcached_server_error() can be used to look at the text of the last error message sent by the server to to the client. (yes the original says "to to", we're keeping it, it's giving typo chic π)
Before version 0.39 theses functions used a memcached_server_st *. In 0.39 memcached_server_st * was aliased to memcached_server_list_st. This was done for a style reason to help clean up some concepts in the code. a lil glow-up, if you will. π
π RETURN VALUE π
Varies, see particular functions. that's it, that's the answer, check the individual function babe π
π SEE ALSO π
and that's the whole page bestie!! π this is version 1.1, dated Jul 24, 2025, from the libmemcached-awesome girlies. go forth and count your servers, mwah πβ¨π¦π
π¦ where this page comes from
- fedora 43: libmemcached-awesome-devel 1.1.4-7.fc43 Β· BSD-3-Clause
- fedora 43: libmemcached-awesome-devel 1.1.4-7.fc43 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms