3 memcached_server_count, memcached_server_list, memcached_server_add, memcached_server_push, memcached_server_get_last_disconnect - Manage server list
7 C Client Library for memcached (libmemcached, -lmemcached)
11 #include <memcached.h>
13 unsigned int memcached_server_count (memcached_st *ptr);
16 memcached_server_list (memcached_st *ptr);
19 memcached_server_add (memcached_st *ptr,
24 memcached_server_add_udp (memcached_st *ptr,
29 memcached_server_add_unix_socket (memcached_st *ptr,
33 memcached_server_push (memcached_st *ptr,
34 memcached_server_st *list);
37 memcached_server_by_key (memcached_st *ptr,
38 const char *key, size_t key_length,
39 memcached_return *error);
41 memcached_server_get_last_disconnect (memcached_st *ptr)
46 libmemcached(3) performs operations on a list of hosts. The order of these
47 hosts determine routing to keys. Functions are provided to add keys to
48 memcached_st structures. To manipulate lists of servers see
49 memcached_server_st(3).
51 memcached_server_count() provides you a count of the current number of
52 servers being used by a C<memcached_st> structure.
54 memcached_server_list() is used to provide an array of all defined hosts.
55 You are responsible for freeing this list (aka it is not a pointer to the
56 currently used structure).
58 memcached_server_add() pushes a single TCP server into the C<memcached_st>
59 structure. This server will be placed at the end. Duplicate servers are
60 allowed, so duplication is not checked. Executing this function with the
61 C<MEMCACHED_BEHAVIOR_USE_UDP> behavior set will result in a
62 C<MEMCACHED_INVALID_HOST_PROTOCOL>.
64 memcached_server_add_udp() pushes a single UDP server into the C<memcached_st>
65 structure. This server will be placed at the end. Duplicate servers are
66 allowed, so duplication is not checked. Executing this function with out
67 setting the C<MEMCACHED_BEHAVIOR_USE_UDP> behavior will result in a
68 C<MEMCACHED_INVALID_HOST_PROTOCOL>.
70 memcached_server_add_unix_socket() pushes a single UNIX socket into the
71 C<memcached_st> structure. This UNIX socket will be placed at the end.
72 Duplicate servers are allowed, so duplication is not checked. The length
73 of the filename must be one character less then MEMCACHED_MAX_HOST_LENGTH.
75 memcached_server_push() pushes an array of C<memcached_server_st> into
76 the C<memcached_st> structure. These servers will be placed at the
77 end. Duplicate servers are allowed, so duplication is not checked. A
78 copy is made of structure so the list provided (and any operations on
79 the list) are not saved.
81 memcached_server_by_key() allows you to provide a key and retrieve the
82 server which would be used for assignment. This structure is cloned
83 from its original structure and must be freed. If NULL is returned you
84 should consult *error. The returning structure should be freed with
85 memcached_server_free().
87 memcached_server_get_last_disconnect() returns a pointer to the last server
88 for which there was a connection problem. It does not mean this particular
89 server is currently dead but if the library is reporting a server is,
90 the returned server is a very good candidate.
94 Varies, see particular functions.
98 To find out more information please check:
99 L<http://tangent.org/552/libmemcached.html>
103 Brian Aker, E<lt>brian@tangent.orgE<gt>
107 memcached(1) libmemcached(3) memcached_strerror(3)