Add docs for tap, and update all other documentation.
[m6w6/libmemcached] / docs / man / memcached_server_add.3
1 .TH "MEMCACHED_SERVER_ADD" "3" "April 11, 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 .SS 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 memcached_server_add (memcached_st *ptr, const char *hostname, in_port_t port);
47
48 memcached_return_t memcached_server_add_udp (memcached_st *ptr, const char *hostname, in_port_t port);
49
50 memcached_return_t memcached_server_add_unix_socket (memcached_st *ptr, const char *socket);
51
52 memcached_return_t memcached_server_push (memcached_st *ptr, const memcached_server_st *list);
53
54 memcached_server_instance_st memcached_server_by_key (const memcached_st *ptr, const char *key, size_t key_length, memcached_return_t *error);
55
56 memcached_server_instance_st memcached_server_get_last_disconnect (const memcached_st *ptr)
57
58 memcached_return_t memcached_server_cursor(const memcached_st *ptr, const memcached_server_fn *callback, void *context, uint32_t number_of_callbacks);
59 .ft P
60 .fi
61 .SS DESCRIPTION
62 .sp
63 libmemcached(3) performs operations on a list of hosts. The order of these
64 hosts determine routing to keys. Functions are provided to add keys to
65 memcached_st structures. To manipulate lists of servers see
66 memcached_server_st(3).
67 .sp
68 memcached_server_count() provides you a count of the current number of
69 servers being used by a \fBmemcached_st\fP structure.
70 .sp
71 memcached_server_add() pushes a single TCP server into the \fBmemcached_st\fPstructure. This server will be placed at the end. Duplicate servers are
72 allowed, so duplication is not checked. Executing this function with the
73 \fBMEMCACHED_BEHAVIOR_USE_UDP\fP behavior set will result in a
74 \fBMEMCACHED_INVALID_HOST_PROTOCOL\fP.
75 .sp
76 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
77 allowed, so duplication is not checked. Executing this function with out
78 setting the \fBMEMCACHED_BEHAVIOR_USE_UDP\fP behavior will result in a
79 \fBMEMCACHED_INVALID_HOST_PROTOCOL\fP.
80 .sp
81 memcached_server_add_unix_socket() pushes a single UNIX socket into the
82 \fBmemcached_st\fP structure. This UNIX socket will be placed at the end.
83 Duplicate servers are allowed, so duplication is not checked. The length
84 of the filename must be one character less then MEMCACHED_MAX_HOST_LENGTH.
85 .sp
86 memcached_server_push() pushes an array of \fBmemcached_server_st\fP into
87 the \fBmemcached_st\fP structure. These servers will be placed at the
88 end. Duplicate servers are allowed, so duplication is not checked. A
89 copy is made of structure so the list provided (and any operations on
90 the list) are not saved.
91 .sp
92 memcached_server_by_key() allows you to provide a key and retrieve the
93 server which would be used for assignment. This structure is cloned
94 from its original structure and must be freed. If NULL is returned you
95 should consult *error. The returning structure should be freed with
96 memcached_server_free().
97 .sp
98 memcached_server_get_last_disconnect() returns a pointer to the last server
99 for which there was a connection problem. It does not mean this particular
100 server is currently dead but if the library is reporting a server is,
101 the returned server is a very good candidate.
102 .sp
103 memcached_server_cursor() takes a memcached_st and loops through the
104 list of hosts currently in the cursor calling the list of callback
105 functions provided. You can optionally pass in a value via
106 context which will be provided to each callback function. An error
107 return from any callback will terminate the loop. memcached_server_cursor()
108 is passed the original caller memcached_st in its current state.
109 .SH RETURN
110 .sp
111 Varies, see particular functions.
112 .SH HOME
113 .sp
114 To find out more information please check:
115 \fI\%https://launchpad.net/libmemcached\fP
116 .SS SEE ALSO
117 .sp
118 \fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
119 .SH AUTHOR
120 Brian Aker
121 .SH COPYRIGHT
122 2011, Brian Aker DataDifferential, http://datadifferential.com/
123 .\" Generated by docutils manpage writer.
124 .\"
125 .