1 .TH "MEMCACHED_SERVER_ADD" "3" "April 07, 2011" "0.47" "libmemcached"
3 memcached_server_add \- libmemcached Documentation
5 .nr rst2man-indent-level 0
9 level \\n[rst2man-indent-level]
10 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
17 .\" .rstReportMargin pre:
19 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20 . nr rst2man-indent-level +1
21 .\" .rstReportMargin post:
25 .\" indent \\n[an-margin]
26 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27 .nr rst2man-indent-level -1
28 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
31 .\" Man page generated from reStructeredText.
37 C Client Library for memcached (libmemcached, \-lmemcached)
42 #include <libmemcached/memcached.h>
44 uint32_t memcached_server_count (memcached_st *ptr);
47 memcached_server_add (memcached_st *ptr,
52 memcached_server_add_udp (memcached_st *ptr,
57 memcached_server_add_unix_socket (memcached_st *ptr,
61 memcached_server_push (memcached_st *ptr,
62 const memcached_server_st *list);
64 memcached_server_instance_st
65 memcached_server_by_key (const memcached_st *ptr,
68 memcached_return_t *error);
70 memcached_server_instance_st
71 memcached_server_get_last_disconnect (const memcached_st *ptr)
74 memcached_server_cursor(const memcached_st *ptr,
75 const memcached_server_fn *callback,
77 uint32_t number_of_callbacks);
82 libmemcached(3) performs operations on a list of hosts. The order of these
83 hosts determine routing to keys. Functions are provided to add keys to
84 memcached_st structures. To manipulate lists of servers see
85 memcached_server_st(3).
87 memcached_server_count() provides you a count of the current number of
88 servers being used by a \fBmemcached_st\fP structure.
90 memcached_server_add() pushes a single TCP server into the \fBmemcached_st\fPstructure. This server will be placed at the end. Duplicate servers are
91 allowed, so duplication is not checked. Executing this function with the
92 \fBMEMCACHED_BEHAVIOR_USE_UDP\fP behavior set will result in a
93 \fBMEMCACHED_INVALID_HOST_PROTOCOL\fP.
95 memcached_server_add_udp() pushes a single UDP server into the \fBmemcached_st\fPstructure. This server will be placed at the end. Duplicate servers are
96 allowed, so duplication is not checked. Executing this function with out
97 setting the \fBMEMCACHED_BEHAVIOR_USE_UDP\fP behavior will result in a
98 \fBMEMCACHED_INVALID_HOST_PROTOCOL\fP.
100 memcached_server_add_unix_socket() pushes a single UNIX socket into the
101 \fBmemcached_st\fP structure. This UNIX socket will be placed at the end.
102 Duplicate servers are allowed, so duplication is not checked. The length
103 of the filename must be one character less then MEMCACHED_MAX_HOST_LENGTH.
105 memcached_server_push() pushes an array of \fBmemcached_server_st\fP into
106 the \fBmemcached_st\fP structure. These servers will be placed at the
107 end. Duplicate servers are allowed, so duplication is not checked. A
108 copy is made of structure so the list provided (and any operations on
109 the list) are not saved.
111 memcached_server_by_key() allows you to provide a key and retrieve the
112 server which would be used for assignment. This structure is cloned
113 from its original structure and must be freed. If NULL is returned you
114 should consult *error. The returning structure should be freed with
115 memcached_server_free().
117 memcached_server_get_last_disconnect() returns a pointer to the last server
118 for which there was a connection problem. It does not mean this particular
119 server is currently dead but if the library is reporting a server is,
120 the returned server is a very good candidate.
122 memcached_server_cursor() takes a memcached_st and loops through the
123 list of hosts currently in the cursor calling the list of callback
124 functions provided. You can optionally pass in a value via
125 context which will be provided to each callback function. An error
126 return from any callback will terminate the loop. memcached_server_cursor()
127 is passed the original caller memcached_st in its current state.
130 Varies, see particular functions.
133 To find out more information please check:
134 \fI\%https://launchpad.net/libmemcached\fP
137 Brian Aker, <\fI\%brian@tangent.org\fP>
140 memcached(1) libmemcached(3) memcached_strerror(3)
145 .\" Generated by docutils manpage writer.