1MEMCACHED_SERVER_COUNT(3) libmemcached MEMCACHED_SERVER_COUNT(3)
2
3
4
6 memcached_server_count - libmemcached Documentation
7
9 #include <libmemcached/memcached.h>
10
11 memcached_server_fn
12
13 uint32_t memcached_server_count(memcached_st *ptr)
14
15 memcached_return_t memcached_server_add(memcached_st *ptr, const
16 char *hostname, in_port_t port)
17
18 memcached_return_t memcached_server_add_udp(memcached_st *ptr, const
19 char *hostname, in_port_t port)
20
21 memcached_return_t memcached_server_add_unix_socket(memcached_st *ptr,
22 const char *socket)
23
24 memcached_return_t memcached_server_push(memcached_st *ptr, const mem‐
25 cached_server_st *list)
26
27 const memcached_instance_st * memcached_server_by_key(mem‐
28 cached_st *ptr, const char *key, size_t key_length, mem‐
29 cached_return_t *error)
30
31 const memcached_instance_st * memcached_server_get_last_discon‐
32 nect(const memcached_st *ptr)
33
34 memcached_return_t memcached_server_cursor(const memcached_st *ptr,
35 const memcached_server_fn *callback, void *context, uint32_t num‐
36 ber_of_callbacks)
37
38 compile and link with -lmemcached
39
41 libmemcached performs operations on a list of hosts. The order of these
42 hosts determine routing to keys. Functions are provided to add keys to
43 memcached_st structures. To manipulate lists of servers see mem‐
44 cached_server_st(3).
45
46 memcached_server_count() provides you a count of the current number of
47 servers being used by a memcached_st structure.
48
49 memcached_server_add() pushes a single TCP server into the memcached_st
50 structure. This server will be placed at the end. Duplicate servers
51 are allowed, so duplication is not checked. Executing this func‐
52 tion with the MEMCACHED_BEHAVIOR_USE_UDP behavior set will
53 result in a MEMCACHED_INVALID_HOST_PROTOCOL.
54
55 memcached_server_add_udp() pushes a single UDP server into the mem‐
56 cached_st structure. This server will be placed at the end. Duplicate
57 servers are allowed, so duplication is not checked. Executing this
58 function with out setting the MEMCACHED_BEHAVIOR_USE_UDP behavior will
59 result in a MEMCACHED_INVALID_HOST_PROTOCOL.
60
61 memcached_server_add_unix_socket() pushes a single UNIX socket into the
62 memcached_st structure. This UNIX socket will be placed at the end.
63 Duplicate servers are allowed, so duplication is not checked. The
64 length of the filename must be one character less than MEM‐
65 CACHED_MAX_HOST_LENGTH.
66
67 memcached_server_push() pushes an array of memcached_server_st into the
68 memcached_st structure. These servers will be placed at the end. Dupli‐
69 cate servers are allowed, so duplication is not checked. A copy is made
70 of structure so the list provided (and any operations on the list) are
71 not saved.
72
73 memcached_server_by_key() allows you to provide a key and retrieve the
74 server which would be used for assignment.
75
76 memcached_server_get_last_disconnect() returns a pointer to the last
77 server for which there was a connection problem. It does not mean this
78 particular server is currently dead but if the library is reporting a
79 server is, the returned server is a very good candidate.
80
81 memcached_server_cursor() takes a memcached_st and loops through the
82 list of hosts currently in the cursor calling the list of callback
83 functions provided. You can optionally pass in a value via context
84 which will be provided to each callback function. An error return from
85 any callback will terminate the loop. memcached_server_cursor() is
86 passed the original caller memcached_st in its current state.
87
89 Varies, see particular functions.
90
92 To find out more information please check: http://libmemcached.org/
93
95 memcached(1) libmemcached(3) memcached_strerror(3)
96
98 Brian Aker
99
101 2011-2013, Brian Aker DataDifferential, http://datadifferential.com/
102
103
104
105
1061.0.18 February 09, 2014 MEMCACHED_SERVER_COUNT(3)