1 .TH "MEMCACHED_SERVERS" "3" "July 21, 2011" "0.51" "libmemcached"
3 memcached_servers \- 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.
35 #include <libmemcached/memcached.h>
38 .B memcached_server_fn
42 .B uint32_t memcached_server_count(memcached_st\fI\ *ptr\fP)
46 .B memcached_return_t memcached_server_add(memcached_st\fI\ *ptr\fP, const char\fI\ *hostname\fP, in_port_t\fI\ port\fP)
50 .B memcached_return_t memcached_server_add_udp(memcached_st\fI\ *ptr\fP, const char\fI\ *hostname\fP, in_port_t\fI\ port\fP)
54 .B memcached_return_t memcached_server_add_unix_socket(memcached_st\fI\ *ptr\fP, const char\fI\ *socket\fP)
58 .B memcached_return_t memcached_server_push(memcached_st\fI\ *ptr\fP, const memcached_server_st\fI\ *list\fP)
62 .B memcached_server_instance_st memcached_server_by_key(const memcached_st\fI\ *ptr\fP, const char\fI\ *key\fP, size_t\fI\ key_length\fP, memcached_return_t\fI\ *error\fP)
66 .B memcached_server_instance_st memcached_server_get_last_disconnect(const memcached_st\fI\ *ptr\fP)
70 .B memcached_return_t memcached_server_cursor(const memcached_st\fI\ *ptr\fP, const \fI\%memcached_server_fn\fP\fI\ *callback\fP, void\fI\ *context\fP, uint32_t\fI\ number_of_callbacks\fP)
73 compile and link with \-lmemcached
76 \fBlibmemcached\fP performs operations on a list of hosts. The order of
77 these hosts determine routing to keys. Functions are provided to add keys to
78 memcached_st structures. To manipulate lists of servers see
79 memcached_server_st(3).
81 \fI\%memcached_server_count()\fP provides you a count of the current number of
82 servers being used by a \fBmemcached_st\fP structure.
85 .B \fI\%memcached_server_add()\fP pushes a single TCP server into the \fBmemcached_st\fP structure. This server will be placed at the end. Duplicate servers
87 are allowed, so duplication is not checked. Executing this function with the \fBMEMCACHED_BEHAVIOR_USE_UDP\fP behavior set will result in a \fBMEMCACHED_INVALID_HOST_PROTOCOL\fP.
90 \fI\%memcached_server_add_udp()\fP pushes a single UDP server into the \fBmemcached_st\fP structure. This server will be placed at the end. Duplicate
91 servers are allowed, so duplication is not checked. Executing this function with out setting the \fBMEMCACHED_BEHAVIOR_USE_UDP\fP behavior will result in a
92 \fBMEMCACHED_INVALID_HOST_PROTOCOL\fP.
94 \fI\%memcached_server_add_unix_socket()\fP pushes a single UNIX socket into the \fBmemcached_st\fP structure. This UNIX socket will be placed at the end.
95 Duplicate servers are allowed, so duplication is not checked. The length
96 of the filename must be one character less than \fBMEMCACHED_MAX_HOST_LENGTH\fP.
98 \fI\%memcached_server_push()\fP pushes an array of \fBmemcached_server_st\fP into the \fBmemcached_st\fP structure. These servers will be placed at
99 the end. Duplicate servers are allowed, so duplication is not checked. A
100 copy is made of structure so the list provided (and any operations on
101 the list) are not saved.
103 \fI\%memcached_server_by_key()\fP allows you to provide a key and retrieve the
104 server which would be used for assignment. This structure is cloned
105 from its original structure and must be freed. If NULL is returned you
106 should consult *error. The returning structure should be freed with
107 \fBmemcached_server_free()\fP.
109 \fI\%memcached_server_get_last_disconnect()\fP returns a pointer to the last
110 server for which there was a connection problem. It does not mean this
111 particular server is currently dead but if the library is reporting a server
112 is, the returned server is a very good candidate.
114 \fI\%memcached_server_cursor()\fP takes a memcached_st and loops through the
115 list of hosts currently in the cursor calling the list of callback
116 functions provided. You can optionally pass in a value via
117 context which will be provided to each callback function. An error
118 return from any callback will terminate the loop. \fI\%memcached_server_cursor()\fP is passed the original caller \fBmemcached_st\fP in its current state.
121 Varies, see particular functions.
124 To find out more information please check:
125 \fI\%http://libmemcached.org/\fP
128 \fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
132 2011, Brian Aker DataDifferential, http://datadifferential.com/
133 .\" Generated by docutils manpage writer.