Developing a
memcached
Application
1363
Pushes an existing list of servers onto list of servers configured for a current
memcached_st
structure.
This adds servers to the end of the existing list, and duplicates are not checked.
The
memcached_server_st
structure can be used to create a list of
memcached
servers which can
then be applied individually to
memcached_st
structures.
memcached_server_st *
memcached_server_list_append (memcached_server_st *ptr,
char *hostname,
unsigned int port,
memcached_return *error);
Adds a server, with
hostname
and
port
, to the server list in
ptr
. The result code is handled by the
error
argument, which should point to an existing
memcached_return
variable. The function returns
a pointer to the returned list.
unsigned int memcached_server_list_count (memcached_server_st *ptr);
Returns the number of the servers in the server list.
void memcached_server_list_free (memcached_server_st *ptr);
Frees the memory associated with a server list.
memcached_server_st *memcached_servers_parse (char *server_strings);
Parses a string containing a list of servers, where individual servers are separated by a comma, space,
or both, and where individual servers are of the form
server[:port]
. The return value is a server list
structure.
15.6.3.3.3.
libmemcached
Set Functions
The set-related functions within
libmemcached
provide the same functionality as the core functions
supported by the
memcached
protocol. The full definition for the different functions is the same for
all the base functions (
add
,
replace
,
prepend
,
append
). For example, the function definition for
memcached_set()
is:
memcached_return
memcached_set (memcached_st *ptr,
const char *key,
size_t key_length,
const char *value,
size_t value_length,
time_t expiration,
uint32_t flags);
The
ptr
is the
memcached_st
structure. The
key
and
key_length
define the key name and length,
and
value
and
value_length
the corresponding value and length. You can also set the expiration
and optional flags. For more information, see
Section 15.6.3.3.5, “Controlling
libmemcached
Behaviors”
.
This table outlines the remainder of the set-related
libmemcached
functions and the equivalent core
functions supported by the
memcached
protocol.
libmemcached
Function
Equivalent Core Function
memcached_set(memc, key, key_length,
value, value_length, expiration,
flags)
Generic
set()
operation.
memcached_add(memc, key, key_length,
value, value_length, expiration,
flags)
Generic
add()
function.
memcached_replace(memc, key,
key_length, value, value_length,
expiration, flags)
Generic
replace()
.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...