1memcached_server_count.pop(3)memcached_server_countmemcached_server_count.pop(3)
2
3
4
6 memcached_server_count, memcached_server_list, memcached_server_add,
7 memcached_server_push, memcached_server_get_last_disconnect,
8 memcached_server_cursor - Manage server list
9
11 C Client Library for memcached (libmemcached, -lmemcached)
12
14 #include <memcached.h>
15
16 uint32_t memcached_server_count (memcached_st *ptr);
17
18 memcached_return_t
19 memcached_server_add (memcached_st *ptr,
20 const char *hostname,
21 in_port_t port);
22
23 memcached_return_t
24 memcached_server_add_udp (memcached_st *ptr,
25 const char *hostname,
26 in_port_t port);
27
28 memcached_return_t
29 memcached_server_add_unix_socket (memcached_st *ptr,
30 const char *socket);
31
32 memcached_return_t
33 memcached_server_push (memcached_st *ptr,
34 const memcached_server_st *list);
35
36 memcached_server_instance_st
37 memcached_server_by_key (const memcached_st *ptr,
38 const char *key,
39 size_t key_length,
40 memcached_return_t *error);
41
42 memcached_server_instance_st
43 memcached_server_get_last_disconnect (const memcached_st *ptr)
44
45 memcached_return_t
46 memcached_server_cursor(const memcached_st *ptr,
47 const memcached_server_fn *callback,
48 void *context,
49 uint32_t number_of_callbacks);
50
52 libmemcached(3) performs operations on a list of hosts. The order of
53 these hosts determine routing to keys. Functions are provided to add
54 keys to memcached_st structures. To manipulate lists of servers see
55 memcached_server_st(3).
56
57 memcached_server_count() provides you a count of the current number of
58 servers being used by a "memcached_st" structure.
59
60 memcached_server_add() pushes a single TCP server into the
61 "memcached_st" structure. This server will be placed at the end.
62 Duplicate servers are allowed, so duplication is not checked. Executing
63 this function with the "MEMCACHED_BEHAVIOR_USE_UDP" behavior set will
64 result in a "MEMCACHED_INVALID_HOST_PROTOCOL".
65
66 memcached_server_add_udp() pushes a single UDP server into the
67 "memcached_st" structure. This server will be placed at the end.
68 Duplicate servers are allowed, so duplication is not checked. Executing
69 this function with out setting the "MEMCACHED_BEHAVIOR_USE_UDP"
70 behavior will result in a "MEMCACHED_INVALID_HOST_PROTOCOL".
71
72 memcached_server_add_unix_socket() pushes a single UNIX socket into the
73 "memcached_st" structure. This UNIX socket will be placed at the end.
74 Duplicate servers are allowed, so duplication is not checked. The
75 length of the filename must be one character less then
76 MEMCACHED_MAX_HOST_LENGTH.
77
78 memcached_server_push() pushes an array of "memcached_server_st" into
79 the "memcached_st" structure. These servers will be placed at the end.
80 Duplicate servers are allowed, so duplication is not checked. A copy is
81 made of structure so the list provided (and any operations on the list)
82 are not saved.
83
84 memcached_server_by_key() allows you to provide a key and retrieve the
85 server which would be used for assignment. This structure is cloned
86 from its original structure and must be freed. If NULL is returned you
87 should consult *error. The returning structure should be freed with
88 memcached_server_free().
89
90 memcached_server_get_last_disconnect() returns a pointer to the last
91 server for which there was a connection problem. It does not mean this
92 particular server is currently dead but if the library is reporting a
93 server is, the returned server is a very good candidate.
94
95 memcached_server_cursor() takes a memcached_st and loops through the
96 list of hosts currently in the cursor calling the list of callback
97 functions provided. You can optionally pass in a value via context
98 which will be provided to each callback function. An error return from
99 any callback will terminate the loop. memcached_server_cursor() is
100 passed the original caller memcached_st in its current state.
101
103 Varies, see particular functions.
104
106 To find out more information please check:
107 <https://launchpad.net/libmemcached>
108
110 Brian Aker, <brian@tangent.org>
111
113 memcached(1) libmemcached(3) memcached_strerror(3)
114
115
116
117 2010-06-28 memcached_server_count.pop(3)