Include config.h before any system header to avoid problems with FILE_OFFSET_BITS...
[m6w6/libmemcached] / docs / memcached_servers.pod
1 =head1 NAME
2
3 memcached_server_count, memcached_server_list, memcached_server_add, memcached_server_push - Manage server list
4
5 =head1 LIBRARY
6
7 C Client Library for memcached (libmemcached, -lmemcached)
8
9 =head1 SYNOPSIS
10
11 #include <memcached.h>
12
13 unsigned int memcached_server_count (memcached_st *ptr);
14
15 memcached_server_st *
16 memcached_server_list (memcached_st *ptr);
17
18 memcached_return
19 memcached_server_add (memcached_st *ptr,
20 const char *hostname,
21 unsigned int port);
22
23 memcached_return
24 memcached_server_add_udp (memcached_st *ptr,
25 const char *hostname,
26 unsigned int port);
27
28 memcached_return
29 memcached_server_add_unix_socket (memcached_st *ptr,
30 const char *socket);
31
32 memcached_return
33 memcached_server_push (memcached_st *ptr,
34 memcached_server_st *list);
35
36 memcached_server_st *
37 memcached_server_by_key (memcached_st *ptr,
38 const char *key, size_t key_length,
39 memcached_return *error);
40
41 =head1 DESCRIPTION
42
43 libmemcached(3) performs operations on a list of hosts. The order of these
44 hosts determine routing to keys. Functions are provided to add keys to
45 memcached_st structures. To manipulate lists of servers see
46 memcached_server_st(3).
47
48 memcached_server_count() provides you a count of the current number of
49 servers being used by a C<memcached_st> structure.
50
51 memcached_server_list() is used to provide an array of all defined hosts.
52 You are responsible for freeing this list (aka it is not a pointer to the
53 currently used structure).
54
55 memcached_server_add() pushes a single TCP server into the C<memcached_st>
56 structure. This server will be placed at the end. Duplicate servers are
57 allowed, so duplication is not checked. Executing this function with the
58 C<MEMCACHED_BEHAVIOR_USE_UDP> behavior set will result in a
59 C<MEMCACHED_INVALID_HOST_PROTOCOL>.
60
61 memcached_server_add_udp() pushes a single UDP server into the C<memcached_st>
62 structure. This server will be placed at the end. Duplicate servers are
63 allowed, so duplication is not checked. Executing this function with out
64 setting the C<MEMCACHED_BEHAVIOR_USE_UDP> behavior will result in a
65 C<MEMCACHED_INVALID_HOST_PROTOCOL>.
66
67 memcached_server_add_unix_socket() pushes a single UNIX socket into the
68 C<memcached_st> structure. This UNIX socket will be placed at the end.
69 Duplicate servers are allowed, so duplication is not checked. The length
70 of the filename must be one character less then MEMCACHED_MAX_HOST_LENGTH.
71
72 memcached_server_push() pushes an array of C<memcached_server_st> into
73 the C<memcached_st> structure. These servers will be placed at the
74 end. Duplicate servers are allowed, so duplication is not checked. A
75 copy is made of structure so the list provided (and any operations on
76 the list) are not saved.
77
78 memcached_server_by_key() allows you to provide a key and retrieve the
79 server which would be used for assignment. This structure is cloned
80 from its original structure and must be freed. If NULL is returned you
81 should consult *error. The returning structure should be freed with
82 memcached_server_free().
83
84 =head1 RETURN
85
86 Varies, see particular functions.
87
88 =head1 HOME
89
90 To find out more information please check:
91 L<http://tangent.org/552/libmemcached.html>
92
93 =head1 AUTHOR
94
95 Brian Aker, E<lt>brian@tangent.orgE<gt>
96
97 =head1 SEE ALSO
98
99 memcached(1) libmemcached(3) memcached_strerror(3)
100
101 =cut
102