4 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
5 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
9 <meta name=
"viewport" content=
"width=device-width, initial-scale=1.0">
11 <title>Behaviors of the library
— libmemcached
1.0.99 documentation
</title>
20 <script type=
"text/javascript" src=
"../_static/js/modernizr.min.js"></script>
23 <script type=
"text/javascript" id=
"documentation_options" data-url_root=
"../" src=
"../_static/documentation_options.js"></script>
24 <script src=
"../_static/jquery.js"></script>
25 <script src=
"../_static/underscore.js"></script>
26 <script src=
"../_static/doctools.js"></script>
27 <script src=
"../_static/language_data.js"></script>
29 <script type=
"text/javascript" src=
"../_static/js/theme.js"></script>
34 <link rel=
"stylesheet" href=
"../_static/css/theme.css" type=
"text/css" />
35 <link rel=
"stylesheet" href=
"../_static/pygments.css" type=
"text/css" />
36 <link rel=
"index" title=
"Index" href=
"../genindex.html" />
37 <link rel=
"search" title=
"Search" href=
"../search.html" />
38 <link rel=
"copyright" title=
"Copyright" href=
"../copyright.html" />
39 <link rel=
"next" title=
"Setting callbacks" href=
"memcached_callback.html" />
40 <link rel=
"prev" title=
"Internal Behavior" href=
"index_advanced_internals.html" />
43 <body class=
"wy-body-for-nav">
46 <div class=
"wy-grid-for-nav">
48 <nav data-toggle=
"wy-nav-shift" class=
"wy-nav-side">
49 <div class=
"wy-side-scroll">
50 <div class=
"wy-side-nav-search" >
54 <a href=
"../index.html" class=
"icon icon-home"> libmemcached
71 <form id=
"rtd-search-form" class=
"wy-form" action=
"../search.html" method=
"get">
72 <input type=
"text" name=
"q" placeholder=
"Search docs" />
73 <input type=
"hidden" name=
"check_keywords" value=
"yes" />
74 <input type=
"hidden" name=
"area" value=
"default" />
81 <div class=
"wy-menu wy-menu-vertical" data-spy=
"affix" role=
"navigation" aria-label=
"main navigation">
88 <p class=
"caption"><span class=
"caption-text">libmemcached
</span></p>
90 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libmemcached.html">Introduction
</a></li>
91 <li class=
"toctree-l1 current"><a class=
"reference internal" href=
"index.html">libmemcached API
</a><ul class=
"current">
92 <li class=
"toctree-l2"><a class=
"reference internal" href=
"index_basics.html">Basics
</a></li>
93 <li class=
"toctree-l2"><a class=
"reference internal" href=
"index_data.html">Working with Data
</a></li>
94 <li class=
"toctree-l2"><a class=
"reference internal" href=
"index_errors.html">Messages and Errors
</a></li>
95 <li class=
"toctree-l2 current"><a class=
"reference internal" href=
"index_advanced.html">Advanced Topics
</a></li>
96 <li class=
"toctree-l2"><a class=
"reference internal" href=
"index_deprecated.html">Deprecated Functionality
</a></li>
99 <li class=
"toctree-l1"><a class=
"reference internal" href=
"index_misc.html">Misc
</a><ul>
100 <li class=
"toctree-l2"><a class=
"reference internal" href=
"configuration.html">Configuration
</a></li>
101 <li class=
"toctree-l2"><a class=
"reference internal" href=
"constants.html">Constants
</a></li>
102 <li class=
"toctree-l2"><a class=
"reference internal" href=
"examples.html">Examples
</a></li>
103 <li class=
"toctree-l2"><a class=
"reference internal" href=
"versioning.html">Versioning
</a></li>
107 <p class=
"caption"><span class=
"caption-text">libmemcachedutil
</span></p>
109 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libmemcachedutil.html">Introduction
</a></li>
110 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libmemcachedutil/index.html">libmemcachedutil API
</a><ul>
111 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../libmemcachedutil/memcached_pool.html">Working with memcached pools
</a></li>
115 <p class=
"caption"><span class=
"caption-text">libhashkit
</span></p>
117 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libhashkit.html">Introduction
</a></li>
118 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libhashkit/index.html">libhashkit API
</a><ul>
119 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../libhashkit/hashkit_create.html">Creating a hashkit structure
</a></li>
120 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../libhashkit/hashkit_function.html">Set Hash Function
</a></li>
121 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../libhashkit/hashkit_functions.html">Available Hashes
</a></li>
122 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../libhashkit/hashkit_value.html">Generate hash value
</a></li>
126 <p class=
"caption"><span class=
"caption-text">Client Applications
</span></p>
128 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../bin/index.html">Client Applications
</a><ul>
129 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memcapable.html">memcapable - Checking a Memcached server capabilities and compatibility
</a></li>
130 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memcat.html">memcat - “cat” data from a server
</a></li>
131 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memcp.html">memcp - Copy data to a server
</a></li>
132 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memdump.html">memdump - Dumping your server
</a></li>
133 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memerror.html">memerror - translate an error code to a string
</a></li>
134 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memflush.html">memflush - flush all data from a server
</a></li>
135 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memrm.html">memrm - Remove data from a server
</a></li>
136 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memslap.html">memslap - Load testing and benchmarking a server
</a></li>
137 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memaslap.html">memaslap - Load testing and benchmarking a server
</a></li>
138 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memstat.html">memstat - Gather statistics from a server
</a></li>
139 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memexist.html">memexist - Check for the existence of a key
</a></li>
140 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memparse.html">memparse - Parse an option string
</a></li>
141 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memping.html">memping - Test to see if a server is available.
</a></li>
142 <li class=
"toctree-l2"><a class=
"reference internal" href=
"../bin/memtouch.html">memtouch - Touches a key.
</a></li>
153 <section data-toggle=
"wy-nav-shift" class=
"wy-nav-content-wrap">
156 <nav class=
"wy-nav-top" aria-label=
"top navigation">
158 <i data-toggle=
"wy-nav-top" class=
"fa fa-bars"></i>
159 <a href=
"../index.html">libmemcached
</a>
164 <div class=
"wy-nav-content">
166 <div class=
"rst-content">
184 <div role=
"navigation" aria-label=
"breadcrumbs navigation">
186 <ul class=
"wy-breadcrumbs">
188 <li><a href=
"../index.html">Docs
</a> »</li>
190 <li><a href=
"index.html">libmemcached API
</a> »</li>
192 <li><a href=
"index_advanced.html">Advanced Topics
</a> »</li>
194 <li><a href=
"index_advanced_internals.html">Internal Behavior
</a> »</li>
196 <li>Behaviors of the library
</li>
199 <li class=
"wy-breadcrumbs-aside">
210 <div role=
"main" class=
"document" itemscope=
"itemscope" itemtype=
"http://schema.org/Article">
211 <div itemprop=
"articleBody">
213 <div class=
"section" id=
"behaviors-of-the-library">
214 <h1>Behaviors of the library
<a class=
"headerlink" href=
"#behaviors-of-the-library" title=
"Permalink to this headline">¶
</a></h1>
215 <p>Manipulate the behavior of a memcached_st structure.
</p>
216 <div class=
"section" id=
"synopsis">
217 <span id=
"index-0"></span><h2>SYNOPSIS
<a class=
"headerlink" href=
"#synopsis" title=
"Permalink to this headline">¶
</a></h2>
219 <dt>#include
<libmemcached/memcached.h
></dt><dd><p>Compile and link with -lmemcached
</p>
224 <code class=
"sig-name descname">typedef enum memcached_behavior_t memcached_behavior_t;
</code></dt>
227 <dl class=
"function">
228 <dt id=
"_CPPv422memcached_behavior_getP12memcached_st20memcached_behavior_t">
229 <span id=
"_CPPv322memcached_behavior_getP12memcached_st20memcached_behavior_t"></span><span id=
"_CPPv222memcached_behavior_getP12memcached_st20memcached_behavior_t"></span><span id=
"memcached_behavior_get__memcached_stP.memcached_behavior_t"></span>uint64_t
<code class=
"sig-name descname">memcached_behavior_get
</code><span class=
"sig-paren">(
</span><a class=
"reference internal" href=
"memcached_create.html#_CPPv412memcached_st" title=
"memcached_st">memcached_st
</a> *
<em>ptr
</em>,
<a class=
"reference internal" href=
"#_CPPv420memcached_behavior_t" title=
"memcached_behavior_t">memcached_behavior_t
</a> <em>flag
</em><span class=
"sig-paren">)
</span><a class=
"headerlink" href=
"#_CPPv422memcached_behavior_getP12memcached_st20memcached_behavior_t" title=
"Permalink to this definition">¶
</a><br /></dt>
232 <dl class=
"function">
233 <dt id=
"_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t">
234 <span id=
"_CPPv322memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t"></span><span id=
"_CPPv222memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t"></span><span id=
"memcached_behavior_set__memcached_stP.memcached_behavior_t.uint64_t"></span><a class=
"reference internal" href=
"memcached_return_t.html#_CPPv418memcached_return_t" title=
"memcached_return_t">memcached_return_t
</a> <code class=
"sig-name descname">memcached_behavior_set
</code><span class=
"sig-paren">(
</span><a class=
"reference internal" href=
"memcached_create.html#_CPPv412memcached_st" title=
"memcached_st">memcached_st
</a> *
<em>ptr
</em>,
<a class=
"reference internal" href=
"#_CPPv420memcached_behavior_t" title=
"memcached_behavior_t">memcached_behavior_t
</a> <em>flag
</em>, uint64_t
<em>data
</em><span class=
"sig-paren">)
</span><a class=
"headerlink" href=
"#_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t" title=
"Permalink to this definition">¶
</a><br /></dt>
235 <dd><div class=
"versionchanged">
236 <p><span class=
"versionmodified changed">Changed in version
0.17:
</span>The
<a class=
"reference internal" href=
"#_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t" title=
"memcached_behavior_set::data"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">data
</span></code></a> argument of
<a class=
"reference internal" href=
"#_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t" title=
"memcached_behavior_set"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_behavior_set()
</span></code></a> was changed in
237 from taking a pointer to data value, to taking a uin64_t.
</p>
242 <dt id=
"c.memcached_behavior_t">
243 enum
<a class=
"reference internal" href=
"#c.memcached_behavior_t" title=
"memcached_behavior_t">memcached_behavior_t
</a> <code class=
"sig-name descname">memcached_behavior_t
</code><a class=
"headerlink" href=
"#c.memcached_behavior_t" title=
"Permalink to this definition">¶
</a></dt>
247 <dt id=
"_CPPv420memcached_behavior_t">
248 <span id=
"_CPPv320memcached_behavior_t"></span><span id=
"_CPPv220memcached_behavior_t"></span><em class=
"property">enum
</em><code class=
"sig-name descname">memcached_behavior_t
</code><a class=
"headerlink" href=
"#_CPPv420memcached_behavior_t" title=
"Permalink to this definition">¶
</a><br /></dt>
249 <dd><dl class=
"enumerator">
250 <dt id=
"_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_USE_UDPE">
251 <span id=
"_CPPv3N20memcached_behavior_t26MEMCACHED_BEHAVIOR_USE_UDPE"></span><span id=
"_CPPv2N20memcached_behavior_t26MEMCACHED_BEHAVIOR_USE_UDPE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_USE_UDP
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_USE_UDPE" title=
"Permalink to this definition">¶
</a><br /></dt>
252 <dd><p>Causes
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> to use the UDP transport when communicating with a
253 memcached server. Not all I/O operations are tested when this behavior
255 <p>The following operations will return
<a class=
"reference internal" href=
"memcached_return_t.html#_CPPv4N18memcached_return_t23MEMCACHED_NOT_SUPPORTEDE" title=
"MEMCACHED_NOT_SUPPORTED"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_NOT_SUPPORTED
</span></code></a> when
256 executed with
<a class=
"reference internal" href=
"#_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_USE_UDPE" title=
"memcached_behavior_t::MEMCACHED_BEHAVIOR_USE_UDP"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_BEHAVIOR_USE_UDP
</span></code></a> enabled:
</p>
258 <li><p><a class=
"reference internal" href=
"memcached_version.html#_CPPv417memcached_versionP12memcached_st" title=
"memcached_version"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_version()
</span></code></a>,
</p></li>
259 <li><p><a class=
"reference internal" href=
"memcached_stats.html#_CPPv414memcached_statP12memcached_stPcP18memcached_return_t" title=
"memcached_stat"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_stat()
</span></code></a>,
</p></li>
260 <li><p><a class=
"reference internal" href=
"memcached_get.html#_CPPv413memcached_getP12memcached_stPKc6size_tP6size_tP8uint32_tP18memcached_return_t" title=
"memcached_get"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_get()
</span></code></a>,
</p></li>
261 <li><p><a class=
"reference internal" href=
"memcached_get.html#_CPPv420memcached_get_by_keyP12memcached_stPKc6size_tPKc6size_tP6size_tP8uint32_tP18memcached_return_t" title=
"memcached_get_by_key"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_get_by_key()
</span></code></a>,
</p></li>
262 <li><p><a class=
"reference internal" href=
"memcached_get.html#_CPPv414memcached_mgetP12memcached_stPPCKcPK6size_t6size_t" title=
"memcached_mget"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_mget()
</span></code></a>,
</p></li>
263 <li><p><a class=
"reference internal" href=
"memcached_get.html#_CPPv421memcached_mget_by_keyP12memcached_stPKc6size_tPPCKcPK6size_t6size_t" title=
"memcached_mget_by_key"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_mget_by_key()
</span></code></a>,
</p></li>
264 <li><p><a class=
"reference internal" href=
"memcached_fetch.html#_CPPv415memcached_fetchP12memcached_stPcP6size_tP6size_tP8uint32_tP18memcached_return_t" title=
"memcached_fetch"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_fetch()
</span></code></a>,
</p></li>
265 <li><p><a class=
"reference internal" href=
"memcached_get.html#_CPPv422memcached_fetch_resultP12memcached_stP19memcached_result_stP18memcached_return_t" title=
"memcached_fetch_result"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_fetch_result()
</span></code></a>,
</p></li>
266 <li><p><a class=
"reference internal" href=
"memcached_get.html#_CPPv423memcached_fetch_executeP12memcached_stP20memcached_execute_fnPv8uint32_t" title=
"memcached_fetch_execute"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_fetch_execute()
</span></code></a>.
</p></li>
268 <p>All other operations are tested but are executed in a ‘fire-and-forget’
269 mode, in which once the client has executed the operation, no attempt
270 will be made to ensure the operation has been received and acted on by
272 <p><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> does not allow TCP and UDP servers to be shared within
273 the same
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> client ‘instance’. An attempt to add a TCP
274 server when this behavior is enabled will result in a
275 <a class=
"reference internal" href=
"memcached_return_t.html#_CPPv4N18memcached_return_t31MEMCACHED_INVALID_HOST_PROTOCOLE" title=
"MEMCACHED_INVALID_HOST_PROTOCOL"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_INVALID_HOST_PROTOCOL
</span></code></a>, as will attempting to add a UDP
276 server when this behavior has not been enabled.
</p>
279 <dl class=
"enumerator">
280 <dt id=
"_CPPv4N20memcached_behavior_t27MEMCACHED_BEHAVIOR_NO_BLOCKE">
281 <span id=
"_CPPv3N20memcached_behavior_t27MEMCACHED_BEHAVIOR_NO_BLOCKE"></span><span id=
"_CPPv2N20memcached_behavior_t27MEMCACHED_BEHAVIOR_NO_BLOCKE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_NO_BLOCK
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t27MEMCACHED_BEHAVIOR_NO_BLOCKE" title=
"Permalink to this definition">¶
</a><br /></dt>
282 <dd><p>Causes
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> to use asynchronous IO. This is the fastest
283 transport available for storage functions.
</p>
286 <dl class=
"enumerator">
287 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SND_TIMEOUTE">
288 <span id=
"_CPPv3N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SND_TIMEOUTE"></span><span id=
"_CPPv2N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SND_TIMEOUTE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_SND_TIMEOUT
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SND_TIMEOUTE" title=
"Permalink to this definition">¶
</a><br /></dt>
289 <dd><p>This sets the microsecond behavior of the socket against the SO_SNDTIMEO
291 <p>In cases where you cannot use non-blocking IO this will allow you to
292 still have timeouts on the sending of data.
</p>
295 <dl class=
"enumerator">
296 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_RCV_TIMEOUTE">
297 <span id=
"_CPPv3N20memcached_behavior_t30MEMCACHED_BEHAVIOR_RCV_TIMEOUTE"></span><span id=
"_CPPv2N20memcached_behavior_t30MEMCACHED_BEHAVIOR_RCV_TIMEOUTE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_RCV_TIMEOUT
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_RCV_TIMEOUTE" title=
"Permalink to this definition">¶
</a><br /></dt>
298 <dd><p>This sets the microsecond behavior of the socket against the SO_RCVTIMEO
300 <p>In cases where you cannot use non-blocking IO this will allow you to
301 still have timeouts on the reading of data.
</p>
304 <dl class=
"enumerator">
305 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_TCP_NODELAYE">
306 <span id=
"_CPPv3N20memcached_behavior_t30MEMCACHED_BEHAVIOR_TCP_NODELAYE"></span><span id=
"_CPPv2N20memcached_behavior_t30MEMCACHED_BEHAVIOR_TCP_NODELAYE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_TCP_NODELAY
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_TCP_NODELAYE" title=
"Permalink to this definition">¶
</a><br /></dt>
307 <dd><p>Turns on the no-delay feature for connecting sockets (may be faster in
308 some environments).
</p>
311 <dl class=
"enumerator">
312 <dt id=
"_CPPv4N20memcached_behavior_t23MEMCACHED_BEHAVIOR_HASHE">
313 <span id=
"_CPPv3N20memcached_behavior_t23MEMCACHED_BEHAVIOR_HASHE"></span><span id=
"_CPPv2N20memcached_behavior_t23MEMCACHED_BEHAVIOR_HASHE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_HASH
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t23MEMCACHED_BEHAVIOR_HASHE" title=
"Permalink to this definition">¶
</a><br /></dt>
314 <dd><p>Set the hash algorithm used for keys.
</p>
315 <p>The value can be set to either:
</p>
317 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv422MEMCACHED_HASH_DEFAULT" title=
"MEMCACHED_HASH_DEFAULT"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_DEFAULT
</span></code></a>,
</p></li>
318 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv418MEMCACHED_HASH_MD5" title=
"MEMCACHED_HASH_MD5"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_MD5
</span></code></a>,
</p></li>
319 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv418MEMCACHED_HASH_CRC" title=
"MEMCACHED_HASH_CRC"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_CRC
</span></code></a>,
</p></li>
320 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv422MEMCACHED_HASH_FNV1_64" title=
"MEMCACHED_HASH_FNV1_64"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_FNV1_64
</span></code></a>,
</p></li>
321 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv423MEMCACHED_HASH_FNV1A_64" title=
"MEMCACHED_HASH_FNV1A_64"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_FNV1A_64
</span></code></a>,
</p></li>
322 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv422MEMCACHED_HASH_FNV1_32" title=
"MEMCACHED_HASH_FNV1_32"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_FNV1_32
</span></code></a>,
</p></li>
323 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv423MEMCACHED_HASH_FNV1A_32" title=
"MEMCACHED_HASH_FNV1A_32"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_FNV1A_32
</span></code></a>,
</p></li>
324 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv422MEMCACHED_HASH_JENKINS" title=
"MEMCACHED_HASH_JENKINS"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_JENKINS
</span></code></a>,
</p></li>
325 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv420MEMCACHED_HASH_HSIEH" title=
"MEMCACHED_HASH_HSIEH"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_HSIEH
</span></code></a>, and
</p></li>
326 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv421MEMCACHED_HASH_MURMUR" title=
"MEMCACHED_HASH_MURMUR"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_MURMUR
</span></code></a>.
</p></li>
328 <p>Each hash has its advantages and its weaknesses. If you don’t know or
329 don’t care, just go with the default.
</p>
330 <p>Support for
<a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv420MEMCACHED_HASH_HSIEH" title=
"MEMCACHED_HASH_HSIEH"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_HSIEH
</span></code></a> is a compile time option that is
331 disabled by default. To enable tests for this hashing algorithm,
332 configure and build libmemcached with the Hsieh hash enabled.
</p>
335 <dl class=
"enumerator">
336 <dt id=
"_CPPv4N20memcached_behavior_t31MEMCACHED_BEHAVIOR_DISTRIBUTIONE">
337 <span id=
"_CPPv3N20memcached_behavior_t31MEMCACHED_BEHAVIOR_DISTRIBUTIONE"></span><span id=
"_CPPv2N20memcached_behavior_t31MEMCACHED_BEHAVIOR_DISTRIBUTIONE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_DISTRIBUTION
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t31MEMCACHED_BEHAVIOR_DISTRIBUTIONE" title=
"Permalink to this definition">¶
</a><br /></dt>
338 <dd><p>Using this you can enable different means of distributing values to
340 <p>The default method is
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_MODULA
</span></code>.
</p>
341 <p>You can enable consistent hashing by setting
342 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT
</span></code>. Consistent hashing delivers better
343 distribution and allows servers to be added to the cluster with minimal
345 <p>Currently
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT
</span></code> is an alias for the
346 value type:
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
</span></code>.
</p>
349 <dl class=
"enumerator">
350 <dt id=
"_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_CACHE_LOOKUPSE">
351 <span id=
"_CPPv3N20memcached_behavior_t32MEMCACHED_BEHAVIOR_CACHE_LOOKUPSE"></span><span id=
"_CPPv2N20memcached_behavior_t32MEMCACHED_BEHAVIOR_CACHE_LOOKUPSE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_CACHE_LOOKUPS
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_CACHE_LOOKUPSE" title=
"Permalink to this definition">¶
</a><br /></dt>
353 <div><div class=
"deprecated">
354 <p><span class=
"versionmodified deprecated">Deprecated since version
0.46(?):
</span>DNS lookups are now always cached until an error occurs with the
358 <p>Memcached can cache named lookups so that DNS lookups are made only once.
</p>
361 <dl class=
"enumerator">
362 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SUPPORT_CASE">
363 <span id=
"_CPPv3N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SUPPORT_CASE"></span><span id=
"_CPPv2N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SUPPORT_CASE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_SUPPORT_CAS
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SUPPORT_CASE" title=
"Permalink to this definition">¶
</a><br /></dt>
364 <dd><p>Support CAS operations (this is not enabled by default at this point in
365 the server since it imposes a slight performance penalty).
</p>
368 <dl class=
"enumerator">
369 <dt id=
"_CPPv4N20memcached_behavior_t25MEMCACHED_BEHAVIOR_KETAMAE">
370 <span id=
"_CPPv3N20memcached_behavior_t25MEMCACHED_BEHAVIOR_KETAMAE"></span><span id=
"_CPPv2N20memcached_behavior_t25MEMCACHED_BEHAVIOR_KETAMAE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_KETAMA
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t25MEMCACHED_BEHAVIOR_KETAMAE" title=
"Permalink to this definition">¶
</a><br /></dt>
371 <dd><p>Sets the default distribution to
372 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
</span></code> and the hash to
373 <a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv418MEMCACHED_HASH_MD5" title=
"MEMCACHED_HASH_MD5"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_MD5
</span></code></a>.
</p>
376 <dl class=
"enumerator">
377 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_KETAMA_WEIGHTEDE">
378 <span id=
"_CPPv3N20memcached_behavior_t34MEMCACHED_BEHAVIOR_KETAMA_WEIGHTEDE"></span><span id=
"_CPPv2N20memcached_behavior_t34MEMCACHED_BEHAVIOR_KETAMA_WEIGHTEDE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_KETAMA_WEIGHTEDE" title=
"Permalink to this definition">¶
</a><br /></dt>
379 <dd><p>Sets the default distribution to
380 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
</span></code> with the weighted tests.
381 Makes the default hashing algorithm for keys use MD5.
</p>
384 <dl class=
"enumerator">
385 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_KETAMA_HASHE">
386 <span id=
"_CPPv3N20memcached_behavior_t30MEMCACHED_BEHAVIOR_KETAMA_HASHE"></span><span id=
"_CPPv2N20memcached_behavior_t30MEMCACHED_BEHAVIOR_KETAMA_HASHE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_KETAMA_HASH
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_KETAMA_HASHE" title=
"Permalink to this definition">¶
</a><br /></dt>
387 <dd><p>Sets the hashing algorithm for host mapping on continuum.
</p>
388 <p>The value can be set to either:
</p>
390 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv422MEMCACHED_HASH_DEFAULT" title=
"MEMCACHED_HASH_DEFAULT"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_DEFAULT
</span></code></a>,
</p></li>
391 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv418MEMCACHED_HASH_MD5" title=
"MEMCACHED_HASH_MD5"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_MD5
</span></code></a>,
</p></li>
392 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv418MEMCACHED_HASH_CRC" title=
"MEMCACHED_HASH_CRC"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_CRC
</span></code></a>,
</p></li>
393 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv422MEMCACHED_HASH_FNV1_64" title=
"MEMCACHED_HASH_FNV1_64"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_FNV1_64
</span></code></a>,
</p></li>
394 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv423MEMCACHED_HASH_FNV1A_64" title=
"MEMCACHED_HASH_FNV1A_64"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_FNV1A_64
</span></code></a>,
</p></li>
395 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv422MEMCACHED_HASH_FNV1_32" title=
"MEMCACHED_HASH_FNV1_32"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_FNV1_32
</span></code></a>, and
</p></li>
396 <li><p><a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv423MEMCACHED_HASH_FNV1A_32" title=
"MEMCACHED_HASH_FNV1A_32"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_FNV1A_32
</span></code></a>.
</p></li>
400 <dl class=
"enumerator">
401 <dt id=
"_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_KETAMA_COMPATE">
402 <span id=
"_CPPv3N20memcached_behavior_t32MEMCACHED_BEHAVIOR_KETAMA_COMPATE"></span><span id=
"_CPPv2N20memcached_behavior_t32MEMCACHED_BEHAVIOR_KETAMA_COMPATE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_KETAMA_COMPAT
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_KETAMA_COMPATE" title=
"Permalink to this definition">¶
</a><br /></dt>
403 <dd><p>Sets the compatibility mode. The value can be set to either
404 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_KETAMA_COMPAT_LIBMEMCACHED
</span></code> (this is the default) or
405 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_KETAMA_COMPAT_SPY
</span></code> to be compatible with the SPY Memcached
409 <dl class=
"enumerator">
410 <dt id=
"_CPPv4N20memcached_behavior_t31MEMCACHED_BEHAVIOR_POLL_TIMEOUTE">
411 <span id=
"_CPPv3N20memcached_behavior_t31MEMCACHED_BEHAVIOR_POLL_TIMEOUTE"></span><span id=
"_CPPv2N20memcached_behavior_t31MEMCACHED_BEHAVIOR_POLL_TIMEOUTE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_POLL_TIMEOUT
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t31MEMCACHED_BEHAVIOR_POLL_TIMEOUTE" title=
"Permalink to this definition">¶
</a><br /></dt>
412 <dd><p>Modify the timeout in milliseconds value that is used by poll. The
413 default value is -
1. An signed int must be passed to
414 <a class=
"reference internal" href=
"#_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t" title=
"memcached_behavior_set"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_behavior_set()
</span></code></a> to change this value (this requires casting).
415 For
<a class=
"reference internal" href=
"#_CPPv422memcached_behavior_getP12memcached_st20memcached_behavior_t" title=
"memcached_behavior_get"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_behavior_get()
</span></code></a> a ‘signed int’ value will be cast and
416 returned as ‘unsigned long long’.
</p>
419 <dl class=
"enumerator">
420 <dt id=
"_CPPv4N20memcached_behavior_t28MEMCACHED_BEHAVIOR_USER_DATAE">
421 <span id=
"_CPPv3N20memcached_behavior_t28MEMCACHED_BEHAVIOR_USER_DATAE"></span><span id=
"_CPPv2N20memcached_behavior_t28MEMCACHED_BEHAVIOR_USER_DATAE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_USER_DATA
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t28MEMCACHED_BEHAVIOR_USER_DATAE" title=
"Permalink to this definition">¶
</a><br /></dt>
422 <dd><div class=
"deprecated">
423 <p><span class=
"versionmodified deprecated">Deprecated since version
<:
</span>0.30</p>
427 <dl class=
"enumerator">
428 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BUFFER_REQUESTSE">
429 <span id=
"_CPPv3N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BUFFER_REQUESTSE"></span><span id=
"_CPPv2N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BUFFER_REQUESTSE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BUFFER_REQUESTSE" title=
"Permalink to this definition">¶
</a><br /></dt>
430 <dd><p>Enabling buffered IO causes commands to “buffer” instead of being sent.
431 Any action that gets data causes this buffer to be be sent to the remote
432 connection. Quiting the connection or closing down the connection will
433 also cause the buffered data to be pushed to the remote connection.
</p>
436 <dl class=
"enumerator">
437 <dt id=
"_CPPv4N20memcached_behavior_t29MEMCACHED_BEHAVIOR_VERIFY_KEYE">
438 <span id=
"_CPPv3N20memcached_behavior_t29MEMCACHED_BEHAVIOR_VERIFY_KEYE"></span><span id=
"_CPPv2N20memcached_behavior_t29MEMCACHED_BEHAVIOR_VERIFY_KEYE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_VERIFY_KEY
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t29MEMCACHED_BEHAVIOR_VERIFY_KEYE" title=
"Permalink to this definition">¶
</a><br /></dt>
439 <dd><p>Enabling this will cause
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> to test all keys to verify that
440 they are valid keys.
</p>
443 <dl class=
"enumerator">
444 <dt id=
"_CPPv4N20memcached_behavior_t29MEMCACHED_BEHAVIOR_SORT_HOSTSE">
445 <span id=
"_CPPv3N20memcached_behavior_t29MEMCACHED_BEHAVIOR_SORT_HOSTSE"></span><span id=
"_CPPv2N20memcached_behavior_t29MEMCACHED_BEHAVIOR_SORT_HOSTSE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_SORT_HOSTS
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t29MEMCACHED_BEHAVIOR_SORT_HOSTSE" title=
"Permalink to this definition">¶
</a><br /></dt>
446 <dd><p>Enabling this will cause hosts that are added to be placed in the host
447 list in sorted order. This will defeat consistent hashing.
</p>
450 <dl class=
"enumerator">
451 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_CONNECT_TIMEOUTE">
452 <span id=
"_CPPv3N20memcached_behavior_t34MEMCACHED_BEHAVIOR_CONNECT_TIMEOUTE"></span><span id=
"_CPPv2N20memcached_behavior_t34MEMCACHED_BEHAVIOR_CONNECT_TIMEOUTE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_CONNECT_TIMEOUTE" title=
"Permalink to this definition">¶
</a><br /></dt>
453 <dd><p>In non-blocking mode this changes the value of the timeout during socket
454 connection in milliseconds. Specifying -
1 means an infinite time‐out.
</p>
457 <dl class=
"enumerator">
458 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BINARY_PROTOCOLE">
459 <span id=
"_CPPv3N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BINARY_PROTOCOLE"></span><span id=
"_CPPv2N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BINARY_PROTOCOLE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BINARY_PROTOCOLE" title=
"Permalink to this definition">¶
</a><br /></dt>
460 <dd><p>Enable the use of the binary protocol. Please note that you cannot
461 toggle this flag on an open connection.
</p>
464 <dl class=
"enumerator">
465 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_IO_MSG_WATERMARKE">
466 <span id=
"_CPPv3N20memcached_behavior_t35MEMCACHED_BEHAVIOR_IO_MSG_WATERMARKE"></span><span id=
"_CPPv2N20memcached_behavior_t35MEMCACHED_BEHAVIOR_IO_MSG_WATERMARKE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_IO_MSG_WATERMARKE" title=
"Permalink to this definition">¶
</a><br /></dt>
467 <dd><p>Set this value to tune the number of messages that may be sent before
468 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> should start to automatically drain the input queue.
</p>
469 <p>Setting this value to high, may cause
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> to deadlock (trying
470 to send data, but the send will block because the input buffer in the
474 <dl class=
"enumerator">
475 <dt id=
"_CPPv4N20memcached_behavior_t37MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARKE">
476 <span id=
"_CPPv3N20memcached_behavior_t37MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARKE"></span><span id=
"_CPPv2N20memcached_behavior_t37MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARKE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t37MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARKE" title=
"Permalink to this definition">¶
</a><br /></dt>
477 <dd><p>Set this value to tune the number of bytes that may be sent before
478 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> should start to automatically drain the input queue (need
479 at least
10 IO requests sent without reading the input buffer).
</p>
480 <p>Setting this value to high, may cause libmemcached to deadlock (trying to
481 send data, but the send will block because the input buffer in the kernel
485 <dl class=
"enumerator">
486 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_IO_KEY_PREFETCHE">
487 <span id=
"_CPPv3N20memcached_behavior_t34MEMCACHED_BEHAVIOR_IO_KEY_PREFETCHE"></span><span id=
"_CPPv2N20memcached_behavior_t34MEMCACHED_BEHAVIOR_IO_KEY_PREFETCHE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_IO_KEY_PREFETCHE" title=
"Permalink to this definition">¶
</a><br /></dt>
488 <dd><p>The binary protocol works a bit different than the textual protocol in
489 that a multiget is implemented as a pipe of single get-operations which
490 are sent to the server in a chunk.
</p>
491 <p>If you are using large multigets from your application, you may improve
492 the latency of the gets by setting this value so you send out the first
493 chunk of requests when you hit the specified limit. It allows the
494 servers to start processing the requests to send the data back while the
495 rest of the requests are created and sent to the server.
</p>
498 <dl class=
"enumerator">
499 <dt id=
"_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_NOREPLYE">
500 <span id=
"_CPPv3N20memcached_behavior_t26MEMCACHED_BEHAVIOR_NOREPLYE"></span><span id=
"_CPPv2N20memcached_behavior_t26MEMCACHED_BEHAVIOR_NOREPLYE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_NOREPLY
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_NOREPLYE" title=
"Permalink to this definition">¶
</a><br /></dt>
501 <dd><p>Set this value to specify that you really don’t care about the result
502 from your storage commands (set, add, replace, append, prepend).
</p>
505 <dl class=
"enumerator">
506 <dt id=
"_CPPv4N20memcached_behavior_t37MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICASE">
507 <span id=
"_CPPv3N20memcached_behavior_t37MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICASE"></span><span id=
"_CPPv2N20memcached_behavior_t37MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICASE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t37MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICASE" title=
"Permalink to this definition">¶
</a><br /></dt>
508 <dd><p>Specify the numbers of replicas
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> should store of each item
509 (on different servers).
</p>
510 <p>This replication does not dedicate certain memcached servers to store
511 the replicas in, but instead it will store the replicas together with
512 all of the other objects (on the ‘n’ next servers specified in your
516 <dl class=
"enumerator">
517 <dt id=
"_CPPv4N20memcached_behavior_t41MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READE">
518 <span id=
"_CPPv3N20memcached_behavior_t41MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READE"></span><span id=
"_CPPv2N20memcached_behavior_t41MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t41MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READE" title=
"Permalink to this definition">¶
</a><br /></dt>
519 <dd><p>Allows randomizing the replica reads starting point. Normally the read
520 is done from primary server and in case of miss the read is done from
521 primary +
1, then primary +
2 all the way to ‘n’ replicas.
</p>
522 <p>If this option is set on the starting point of the replica reads is
523 randomized between the servers. This allows distributing read load to
524 multiple servers with the expense of more write traffic.
</p>
527 <dl class=
"enumerator">
528 <dt id=
"_CPPv4N20memcached_behavior_t23MEMCACHED_BEHAVIOR_CORKE">
529 <span id=
"_CPPv3N20memcached_behavior_t23MEMCACHED_BEHAVIOR_CORKE"></span><span id=
"_CPPv2N20memcached_behavior_t23MEMCACHED_BEHAVIOR_CORKE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_CORK
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t23MEMCACHED_BEHAVIOR_CORKE" title=
"Permalink to this definition">¶
</a><br /></dt>
530 <dd><div class=
"deprecated">
531 <p><span class=
"versionmodified deprecated">Deprecated since version ?:
</span>This open has been deprecated with the behavior now built and used
532 appropriately on selected platforms.
</p>
536 <dl class=
"enumerator">
537 <dt id=
"_CPPv4N20memcached_behavior_t28MEMCACHED_BEHAVIOR_KEEPALIVEE">
538 <span id=
"_CPPv3N20memcached_behavior_t28MEMCACHED_BEHAVIOR_KEEPALIVEE"></span><span id=
"_CPPv2N20memcached_behavior_t28MEMCACHED_BEHAVIOR_KEEPALIVEE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_KEEPALIVE
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t28MEMCACHED_BEHAVIOR_KEEPALIVEE" title=
"Permalink to this definition">¶
</a><br /></dt>
539 <dd><p>Enable TCP_KEEPALIVE behavior.
</p>
542 <dl class=
"enumerator">
543 <dt id=
"_CPPv4N20memcached_behavior_t33MEMCACHED_BEHAVIOR_KEEPALIVE_IDLEE">
544 <span id=
"_CPPv3N20memcached_behavior_t33MEMCACHED_BEHAVIOR_KEEPALIVE_IDLEE"></span><span id=
"_CPPv2N20memcached_behavior_t33MEMCACHED_BEHAVIOR_KEEPALIVE_IDLEE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_KEEPALIVE_IDLE
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t33MEMCACHED_BEHAVIOR_KEEPALIVE_IDLEE" title=
"Permalink to this definition">¶
</a><br /></dt>
545 <dd><p>Specify time, in seconds, to mark a connection as idle. This is only
546 available as an option Linux.
</p>
549 <dl class=
"enumerator">
550 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZEE">
551 <span id=
"_CPPv3N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZEE"></span><span id=
"_CPPv2N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZEE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZEE" title=
"Permalink to this definition">¶
</a><br /></dt>
552 <dd><p>Find the current size of SO_SNDBUF. A value of
0 means either an error
553 occurred or no hosts were available. It is safe to assume system default
555 <p>If an error occurs you can check the last cached errno to find the
559 <dl class=
"enumerator">
560 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZEE">
561 <span id=
"_CPPv3N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZEE"></span><span id=
"_CPPv2N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZEE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZEE" title=
"Permalink to this definition">¶
</a><br /></dt>
562 <dd><p>Find the current size of SO_RCVBUF. A value of
0 means either an error
563 occurred or no hosts were available. It is safe to assume system default
565 <p>If an error occurs you can check the last cached errno to find the
569 <dl class=
"enumerator">
570 <dt id=
"_CPPv4N20memcached_behavior_t39MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMITE">
571 <span id=
"_CPPv3N20memcached_behavior_t39MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMITE"></span><span id=
"_CPPv2N20memcached_behavior_t39MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMITE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t39MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMITE" title=
"Permalink to this definition">¶
</a><br /></dt>
572 <dd><div class=
"deprecated">
573 <p><span class=
"versionmodified deprecated">Deprecated since version
0.48:
</span>See
<a class=
"reference internal" href=
"#_CPPv4N20memcached_behavior_t40MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERSE" title=
"memcached_behavior_t::MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
</span></code></a></p>
575 <p>Set this value to enable the server be removed after continuous
576 <a class=
"reference internal" href=
"#_CPPv4N20memcached_behavior_t39MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMITE" title=
"memcached_behavior_t::MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
</span></code></a> times connection failure.
</p>
579 <dl class=
"enumerator">
580 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTSE">
581 <span id=
"_CPPv3N20memcached_behavior_t35MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTSE"></span><span id=
"_CPPv2N20memcached_behavior_t35MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTSE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTSE" title=
"Permalink to this definition">¶
</a><br /></dt>
582 <dd><div class=
"deprecated">
583 <p><span class=
"versionmodified deprecated">Deprecated since version
0.48:
</span>See
<a class=
"reference internal" href=
"#_CPPv4N20memcached_behavior_t40MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERSE" title=
"memcached_behavior_t::MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
</span></code></a></p>
585 <p>If enabled any hosts which have been flagged as disabled will be removed
586 from the list of servers in the
<a class=
"reference internal" href=
"memcached_create.html#_CPPv412memcached_st" title=
"memcached_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_st
</span></code></a> structure. This must be
587 used in combination with
<a class=
"reference internal" href=
"#_CPPv4N20memcached_behavior_t39MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMITE" title=
"memcached_behavior_t::MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
</span></code></a>.
</p>
590 <dl class=
"enumerator">
591 <dt id=
"_CPPv4N20memcached_behavior_t40MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERSE">
592 <span id=
"_CPPv3N20memcached_behavior_t40MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERSE"></span><span id=
"_CPPv2N20memcached_behavior_t40MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERSE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t40MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERSE" title=
"Permalink to this definition">¶
</a><br /></dt>
593 <dd><p>If enabled any hosts which have been flagged as disabled will be removed
594 from the list of servers in the
<a class=
"reference internal" href=
"memcached_create.html#_CPPv412memcached_st" title=
"memcached_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_st
</span></code></a> structure.
</p>
597 <dl class=
"enumerator">
598 <dt id=
"_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_RETRY_TIMEOUTE">
599 <span id=
"_CPPv3N20memcached_behavior_t32MEMCACHED_BEHAVIOR_RETRY_TIMEOUTE"></span><span id=
"_CPPv2N20memcached_behavior_t32MEMCACHED_BEHAVIOR_RETRY_TIMEOUTE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_RETRY_TIMEOUTE" title=
"Permalink to this definition">¶
</a><br /></dt>
600 <dd><p>When enabled a host which is problematic will only be checked for usage
601 based on the amount of time set by this behavior. The value is in
605 <dl class=
"enumerator">
606 <dt id=
"_CPPv4N20memcached_behavior_t39MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEYE">
607 <span id=
"_CPPv3N20memcached_behavior_t39MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEYE"></span><span id=
"_CPPv2N20memcached_behavior_t39MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEYE"></span><em class=
"property">enumerator
</em><code class=
"sig-name descname">MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t39MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEYE" title=
"Permalink to this definition">¶
</a><br /></dt>
608 <dd><p>When enabled the prefix key will be added to the key when determining
609 server by hash. See
<a class=
"reference internal" href=
"memcached_callback.html#_CPPv4N20memcached_callback_t28MEMCACHED_CALLBACK_NAMESPACEE" title=
"MEMCACHED_CALLBACK_NAMESPACE"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_CALLBACK_NAMESPACE
</span></code></a> for additional
616 <div class=
"section" id=
"description">
617 <h2>DESCRIPTION
<a class=
"headerlink" href=
"#description" title=
"Permalink to this headline">¶
</a></h2>
618 <p><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> behavior can be modified by using
<a class=
"reference internal" href=
"#_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t" title=
"memcached_behavior_set"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_behavior_set()
</span></code></a>.
619 Default behavior is the library strives to be quick and accurate. Some behavior,
620 while being faster, can also result in not entirely accurate behavior (for
621 instance,
<a class=
"reference internal" href=
"memcached_set.html#_CPPv413memcached_setP12memcached_stPKc6size_tPKc6size_t6time_t8uint32_t" title=
"memcached_set"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_set()
</span></code></a> will always respond with
<a class=
"reference internal" href=
"memcached_return_t.html#_CPPv4N18memcached_return_t17MEMCACHED_SUCCESSE" title=
"MEMCACHED_SUCCESS"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_SUCCESS
</span></code></a>).
</p>
622 <p><a class=
"reference internal" href=
"#_CPPv422memcached_behavior_getP12memcached_st20memcached_behavior_t" title=
"memcached_behavior_get"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_behavior_get()
</span></code></a> takes a behavior flag and returns whether or not
623 that behavior is currently enabled in the client.
</p>
624 <p><a class=
"reference internal" href=
"#_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t" title=
"memcached_behavior_set"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_behavior_set()
</span></code></a> changes the value of a particular option of the
625 client. It takes both a flag (listed below) and a value. For simple on or off
626 options you just need to pass in a value of
1. Calls to
627 <a class=
"reference internal" href=
"#_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t" title=
"memcached_behavior_set"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_behavior_set()
</span></code></a> will flush and reset all connections.
</p>
629 <div class=
"section" id=
"return-value">
630 <h2>RETURN VALUE
<a class=
"headerlink" href=
"#return-value" title=
"Permalink to this headline">¶
</a></h2>
631 <p><a class=
"reference internal" href=
"#_CPPv422memcached_behavior_getP12memcached_st20memcached_behavior_t" title=
"memcached_behavior_get"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_behavior_get()
</span></code></a> returns either the current value of the key, or
0
632 or
1 on simple flag behaviors (
1 being enabled).
<a class=
"reference internal" href=
"#_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t" title=
"memcached_behavior_set"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_behavior_set()
</span></code></a>
633 returns failure or success.
</p>
635 <div class=
"section" id=
"notes">
636 <h2>NOTES
<a class=
"headerlink" href=
"#notes" title=
"Permalink to this headline">¶
</a></h2>
637 <p>The
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">data
</span></code> argument of
<a class=
"reference internal" href=
"#_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t" title=
"memcached_behavior_set"><code class=
"xref cpp cpp-func docutils literal notranslate"><span class=
"pre">memcached_behavior_set()
</span></code></a> was changed in version
638 0.17 from taking a pointer to data value, to taking a uin64_t.
</p>
640 <div class=
"section" id=
"see-also">
641 <h2>SEE ALSO
<a class=
"headerlink" href=
"#see-also" title=
"Permalink to this headline">¶
</a></h2>
643 <li><p><em class=
"manpage"><a class=
"manpage reference external" href=
"http://man7.org/linux/man-pages/man1/memcached.1.html">memcached(
1)
</a></em></p></li>
644 <li><p><em class=
"manpage"><a class=
"manpage reference external" href=
"http://man7.org/linux/man-pages/man3/setsockopt.3.html">setsockopt(
3)
</a></em></p></li>
645 <li><p><a class=
"reference internal" href=
"../libmemcached.html"><span class=
"doc">C/C++ Client Library for memcached
</span></a></p></li>
646 <li><p><a class=
"reference internal" href=
"memcached_strerror.html"><span class=
"doc">Converting Error Codes to Messages
</span></a></p></li>
657 <div class=
"rst-footer-buttons" role=
"navigation" aria-label=
"footer navigation">
659 <a href=
"memcached_callback.html" class=
"btn btn-neutral float-right" title=
"Setting callbacks" accesskey=
"n" rel=
"next">Next
<span class=
"fa fa-arrow-circle-right"></span></a>
662 <a href=
"index_advanced_internals.html" class=
"btn btn-neutral float-left" title=
"Internal Behavior" accesskey=
"p" rel=
"prev"><span class=
"fa fa-arrow-circle-left"></span> Previous
</a>
669 <div role=
"contentinfo">
671 © <a href=
"../copyright.html">Copyright
</a>
675 Built with
<a href=
"http://sphinx-doc.org/">Sphinx
</a> using a
<a href=
"https://github.com/rtfd/sphinx_rtd_theme">theme
</a> provided by
<a href=
"https://readthedocs.org">Read the Docs
</a>.
688 <script type=
"text/javascript">
690 SphinxRtdTheme.Navigation.enable(true);