Merge in more updates for docs (we are just going to check them all in so that users...
[m6w6/libmemcached] / docs / man / memcached_server_add.3
1 .TH "MEMCACHED_SERVER_ADD" "3" "April 07, 2011" "0.47" "libmemcached"
2 .SH NAME
3 memcached_server_add \- libmemcached Documentation
4 .
5 .nr rst2man-indent-level 0
6 .
7 .de1 rstReportMargin
8 \\$1 \\n[an-margin]
9 level \\n[rst2man-indent-level]
10 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
11 -
12 \\n[rst2man-indent0]
13 \\n[rst2man-indent1]
14 \\n[rst2man-indent2]
15 ..
16 .de1 INDENT
17 .\" .rstReportMargin pre:
18 . RS \\$1
19 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20 . nr rst2man-indent-level +1
21 .\" .rstReportMargin post:
22 ..
23 .de UNINDENT
24 . RE
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
30 ..
31 .\" Man page generated from reStructeredText.
32 .
33 .sp
34 Manage server list
35 .SH LIBRARY
36 .sp
37 C Client Library for memcached (libmemcached, \-lmemcached)
38 .SH SYNOPSIS
39 .sp
40 .nf
41 .ft C
42 #include <libmemcached/memcached.h>
43
44 uint32_t memcached_server_count (memcached_st *ptr);
45
46 memcached_return_t
47 memcached_server_add (memcached_st *ptr,
48 const char *hostname,
49 in_port_t port);
50
51 memcached_return_t
52 memcached_server_add_udp (memcached_st *ptr,
53 const char *hostname,
54 in_port_t port);
55
56 memcached_return_t
57 memcached_server_add_unix_socket (memcached_st *ptr,
58 const char *socket);
59
60 memcached_return_t
61 memcached_server_push (memcached_st *ptr,
62 const memcached_server_st *list);
63
64 memcached_server_instance_st
65 memcached_server_by_key (const memcached_st *ptr,
66 const char *key,
67 size_t key_length,
68 memcached_return_t *error);
69
70 memcached_server_instance_st
71 memcached_server_get_last_disconnect (const memcached_st *ptr)
72
73 memcached_return_t
74 memcached_server_cursor(const memcached_st *ptr,
75 const memcached_server_fn *callback,
76 void *context,
77 uint32_t number_of_callbacks);
78 .ft P
79 .fi
80 .SH DESCRIPTION
81 .sp
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).
86 .sp
87 memcached_server_count() provides you a count of the current number of
88 servers being used by a \fBmemcached_st\fP structure.
89 .sp
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.
94 .sp
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.
99 .sp
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.
104 .sp
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.
110 .sp
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().
116 .sp
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.
121 .sp
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.
128 .SH RETURN
129 .sp
130 Varies, see particular functions.
131 .SH HOME
132 .sp
133 To find out more information please check:
134 \fI\%https://launchpad.net/libmemcached\fP
135 .SH AUTHOR
136 .sp
137 Brian Aker, <\fI\%brian@tangent.org\fP>
138 .SH SEE ALSO
139 .sp
140 memcached(1) libmemcached(3) memcached_strerror(3)
141 .SH AUTHOR
142 Brian Aker
143 .SH COPYRIGHT
144 2011, Brian Aker
145 .\" Generated by docutils manpage writer.
146 .\"
147 .