.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Memcached::libmemcached::memcached_servers 3pm" .TH Memcached::libmemcached::memcached_servers 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME memcached_server_count, memcached_server_list, memcached_server_add, memcached_server_push, memcached_server_get_last_disconnect, memcached_server_cursor \- Manage server list .SH LIBRARY .IX Header "LIBRARY" C Client Library for memcached (libmemcached, \-lmemcached) .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& #include \& \& uint32_t memcached_server_count (memcached_st *ptr); \& \& memcached_return_t \& memcached_server_add (memcached_st *ptr, \& const char *hostname, \& in_port_t port); \& \& memcached_return_t \& memcached_server_add_udp (memcached_st *ptr, \& const char *hostname, \& in_port_t port); \& \& memcached_return_t \& memcached_server_add_unix_socket (memcached_st *ptr, \& const char *socket); \& \& memcached_return_t \& memcached_server_push (memcached_st *ptr, \& const memcached_server_st *list); \& \& memcached_server_instance_st \& memcached_server_by_key (const memcached_st *ptr, \& const char *key, \& size_t key_length, \& memcached_return_t *error); \& \& memcached_server_instance_st \& memcached_server_get_last_disconnect (const memcached_st *ptr) \& \& memcached_return_t \& memcached_server_cursor(const memcached_st *ptr, \& const memcached_server_fn *callback, \& void *context, \& uint32_t number_of_callbacks); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBlibmemcached\fR\|(3) performs operations on a list of hosts. The order of these hosts determine routing to keys. Functions are provided to add keys to memcached_st structures. To manipulate lists of servers see \&\fBmemcached_server_st\fR\|(3). .PP \&\fBmemcached_server_count()\fR provides you a count of the current number of servers being used by a \f(CW\*(C`memcached_st\*(C'\fR structure. .PP \&\fBmemcached_server_add()\fR pushes a single TCP server into the \f(CW\*(C`memcached_st\*(C'\fR structure. This server will be placed at the end. Duplicate servers are allowed, so duplication is not checked. Executing this function with the \&\f(CW\*(C`MEMCACHED_BEHAVIOR_USE_UDP\*(C'\fR behavior set will result in a \&\f(CW\*(C`MEMCACHED_INVALID_HOST_PROTOCOL\*(C'\fR. .PP \&\fBmemcached_server_add_udp()\fR pushes a single UDP server into the \f(CW\*(C`memcached_st\*(C'\fR structure. This server will be placed at the end. Duplicate servers are allowed, so duplication is not checked. Executing this function with out setting the \f(CW\*(C`MEMCACHED_BEHAVIOR_USE_UDP\*(C'\fR behavior will result in a \&\f(CW\*(C`MEMCACHED_INVALID_HOST_PROTOCOL\*(C'\fR. .PP \&\fBmemcached_server_add_unix_socket()\fR pushes a single UNIX socket into the \&\f(CW\*(C`memcached_st\*(C'\fR structure. This UNIX socket will be placed at the end. Duplicate servers are allowed, so duplication is not checked. The length of the filename must be one character less then MEMCACHED_MAX_HOST_LENGTH. .PP \&\fBmemcached_server_push()\fR pushes an array of \f(CW\*(C`memcached_server_st\*(C'\fR into the \f(CW\*(C`memcached_st\*(C'\fR structure. These servers will be placed at the end. Duplicate servers are allowed, so duplication is not checked. A copy is made of structure so the list provided (and any operations on the list) are not saved. .PP \&\fBmemcached_server_by_key()\fR allows you to provide a key and retrieve the server which would be used for assignment. This structure is cloned from its original structure and must be freed. If NULL is returned you should consult *error. The returning structure should be freed with \&\fBmemcached_server_free()\fR. .PP \&\fBmemcached_server_get_last_disconnect()\fR returns a pointer to the last server for which there was a connection problem. It does not mean this particular server is currently dead but if the library is reporting a server is, the returned server is a very good candidate. .PP \&\fBmemcached_server_cursor()\fR takes a memcached_st and loops through the list of hosts currently in the cursor calling the list of callback functions provided. You can optionally pass in a value via context which will be provided to each callback function. An error return from any callback will terminate the loop. \fBmemcached_server_cursor()\fR is passed the original caller memcached_st in its current state. .SH RETURN .IX Header "RETURN" Varies, see particular functions. .SH HOME .IX Header "HOME" To find out more information please check: .SH AUTHOR .IX Header "AUTHOR" Brian Aker, .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBmemcached\fR\|(1) \fBlibmemcached\fR\|(3) \fBmemcached_strerror\fR\|(3)