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=
"Library 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><ul class=
"current">
96 <li class=
"toctree-l3 current"><a class=
"reference internal" href=
"index_advanced_internals.html">Internal Behavior
</a><ul class=
"current">
97 <li class=
"toctree-l4 current"><a class=
"current reference internal" href=
"#">Behaviors of the library
</a></li>
98 <li class=
"toctree-l4"><a class=
"reference internal" href=
"memcached_callback.html">Library callbacks
</a></li>
99 <li class=
"toctree-l4"><a class=
"reference internal" href=
"memcached_memory_allocators.html">Use custom allocators for embedded usage
</a></li>
100 <li class=
"toctree-l4"><a class=
"reference internal" href=
"memcached_user_data.html">Storing custom user information in the client.
</a></li>
103 <li class=
"toctree-l3"><a class=
"reference internal" href=
"index_advanced_aeh.html">Authentication, Encryption
& Hashing
</a></li>
104 <li class=
"toctree-l3"><a class=
"reference internal" href=
"index_advanced_servers.html">Servers and Server Lists
</a></li>
105 <li class=
"toctree-l3"><a class=
"reference internal" href=
"index_advanced_daemon.html">Affecting the memcached Daemon
</a></li>
106 <li class=
"toctree-l3"><a class=
"reference internal" href=
"index_advanced_stats.html">Statistics
</a></li>
109 <li class=
"toctree-l2"><a class=
"reference internal" href=
"index_deprecated.html">Deprecated Functionality
</a></li>
112 <li class=
"toctree-l1"><a class=
"reference internal" href=
"index_misc.html">Misc
</a></li>
114 <p class=
"caption"><span class=
"caption-text">libmemcachedutil
</span></p>
116 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libmemcachedutil.html">Introduction
</a></li>
117 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libmemcachedutil/index.html">libmemcachedutil API
</a></li>
119 <p class=
"caption"><span class=
"caption-text">libhashkit
</span></p>
121 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libhashkit.html">Introduction
</a></li>
122 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libhashkit/index.html">libhashkit API
</a></li>
124 <p class=
"caption"><span class=
"caption-text">Client Applications
</span></p>
126 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../bin/index.html">Client Applications
</a></li>
128 <p class=
"caption"><span class=
"caption-text">Copyright
</span></p>
130 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../copyright.html">Copyright
</a></li>
139 <section data-toggle=
"wy-nav-shift" class=
"wy-nav-content-wrap">
142 <nav class=
"wy-nav-top" aria-label=
"top navigation">
144 <i data-toggle=
"wy-nav-top" class=
"fa fa-bars"></i>
145 <a href=
"../index.html">libmemcached
</a>
150 <div class=
"wy-nav-content">
152 <div class=
"rst-content">
170 <div role=
"navigation" aria-label=
"breadcrumbs navigation">
172 <ul class=
"wy-breadcrumbs">
174 <li><a href=
"../index.html">Docs
</a> »</li>
176 <li><a href=
"index.html">libmemcached API
</a> »</li>
178 <li><a href=
"index_advanced.html">Advanced Topics
</a> »</li>
180 <li><a href=
"index_advanced_internals.html">Internal Behavior
</a> »</li>
182 <li>Behaviors of the library
</li>
185 <li class=
"wy-breadcrumbs-aside">
196 <div role=
"main" class=
"document" itemscope=
"itemscope" itemtype=
"http://schema.org/Article">
197 <div itemprop=
"articleBody">
199 <div class=
"section" id=
"behaviors-of-the-library">
200 <h1>Behaviors of the library
<a class=
"headerlink" href=
"#behaviors-of-the-library" title=
"Permalink to this headline">¶
</a></h1>
201 <p>Manipulate the behavior of a memcached_st structure.
</p>
202 <div class=
"section" id=
"synopsis">
203 <span id=
"index-0"></span><h2>SYNOPSIS
<a class=
"headerlink" href=
"#synopsis" title=
"Permalink to this headline">¶
</a></h2>
205 <dt>#include
<libmemcached/memcached.h
></dt><dd><p>Compile and link with -lmemcached
</p>
208 <dl class=
"cpp function">
209 <dt id=
"_CPPv422memcached_behavior_getP12memcached_st20memcached_behavior_t">
210 <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>
213 <dl class=
"cpp function">
214 <dt id=
"_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t">
215 <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>
216 <dd><div class=
"versionchanged">
217 <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-any docutils literal notranslate"><span class=
"pre">memcached_behavior_set()
</span></code></a> was changed in
218 from taking a pointer to data value, to taking a uin64_t.
</p>
222 <dl class=
"cpp type">
223 <dt id=
"_CPPv420memcached_behavior_t">
224 <span id=
"_CPPv320memcached_behavior_t"></span><span id=
"_CPPv220memcached_behavior_t"></span><span id=
"memcached_behavior_t"></span><em class=
"property">typedef
</em><em class=
"property">enum
</em> <a class=
"reference internal" href=
"#_CPPv420memcached_behavior_t" title=
"memcached_behavior_t">memcached_behavior_t
</a> <code class=
"sig-name descname">memcached_behavior_t
</code><a class=
"headerlink" href=
"#_CPPv420memcached_behavior_t" title=
"Permalink to this definition">¶
</a><br /></dt>
227 <dl class=
"cpp enum">
228 <dt id=
"_CPPv420memcached_behavior_t">
229 <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><br /></dt>
230 <dd><dl class=
"cpp enumerator">
231 <dt id=
"_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_USE_UDPE">
232 <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>
233 <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
234 memcached server. Not all I/O operations are tested when this behavior
236 <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
237 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>
239 <li><p><a class=
"reference internal" href=
"memcached_version.html#_CPPv417memcached_versionP12memcached_st" title=
"memcached_version"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_version()
</span></code></a>,
</p></li>
240 <li><p><a class=
"reference internal" href=
"memcached_stats.html#_CPPv414memcached_statP12memcached_stPcP18memcached_return_t" title=
"memcached_stat"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_stat()
</span></code></a>,
</p></li>
241 <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-any docutils literal notranslate"><span class=
"pre">memcached_get()
</span></code></a>,
</p></li>
242 <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-any docutils literal notranslate"><span class=
"pre">memcached_get_by_key()
</span></code></a>,
</p></li>
243 <li><p><a class=
"reference internal" href=
"memcached_get.html#_CPPv414memcached_mgetP12memcached_stPPCKcPK6size_t6size_t" title=
"memcached_mget"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_mget()
</span></code></a>,
</p></li>
244 <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-any docutils literal notranslate"><span class=
"pre">memcached_mget_by_key()
</span></code></a>,
</p></li>
245 <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-any docutils literal notranslate"><span class=
"pre">memcached_fetch()
</span></code></a>,
</p></li>
246 <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-any docutils literal notranslate"><span class=
"pre">memcached_fetch_result()
</span></code></a>,
</p></li>
247 <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-any docutils literal notranslate"><span class=
"pre">memcached_fetch_execute()
</span></code></a>.
</p></li>
249 <p>All other operations are tested but are executed in a 'fire-and-forget'
250 mode, in which once the client has executed the operation, no attempt
251 will be made to ensure the operation has been received and acted on by
253 <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
254 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
255 server when this behavior is enabled will result in a
256 <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
257 server when this behavior has not been enabled.
</p>
260 <dl class=
"cpp enumerator">
261 <dt id=
"_CPPv4N20memcached_behavior_t27MEMCACHED_BEHAVIOR_NO_BLOCKE">
262 <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>
263 <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
264 transport available for storage functions.
</p>
267 <dl class=
"cpp enumerator">
268 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SND_TIMEOUTE">
269 <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>
270 <dd><p>This sets the microsecond behavior of the socket against the SO_SNDTIMEO
272 <p>In cases where you cannot use non-blocking IO this will allow you to
273 still have timeouts on the sending of data.
</p>
276 <dl class=
"cpp enumerator">
277 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_RCV_TIMEOUTE">
278 <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>
279 <dd><p>This sets the microsecond behavior of the socket against the SO_RCVTIMEO
281 <p>In cases where you cannot use non-blocking IO this will allow you to
282 still have timeouts on the reading of data.
</p>
285 <dl class=
"cpp enumerator">
286 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_TCP_NODELAYE">
287 <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>
288 <dd><p>Turns on the no-delay feature for connecting sockets (may be faster in
289 some environments).
</p>
292 <dl class=
"cpp enumerator">
293 <dt id=
"_CPPv4N20memcached_behavior_t23MEMCACHED_BEHAVIOR_HASHE">
294 <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>
295 <dd><p>Set the hash algorithm used for keys.
</p>
296 <p>The value can be set to either:
</p>
298 <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>
299 <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>
300 <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>
301 <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>
302 <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>
303 <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>
304 <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>
305 <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>
306 <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>
307 <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>
309 <p>Each hash has its advantages and its weaknesses. If you don't know or
310 don't care, just go with the default.
</p>
311 <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
312 disabled by default. To enable tests for this hashing algorithm,
313 configure and build libmemcached with the Hsieh hash enabled.
</p>
316 <dl class=
"cpp enumerator">
317 <dt id=
"_CPPv4N20memcached_behavior_t31MEMCACHED_BEHAVIOR_DISTRIBUTIONE">
318 <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>
319 <dd><p>Using this you can enable different means of distributing values to
321 <p>The default method is
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_MODULA
</span></code>.
</p>
322 <p>You can enable consistent hashing by setting
323 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT
</span></code>. Consistent hashing delivers better
324 distribution and allows servers to be added to the cluster with minimal
326 <p>Currently
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT
</span></code> is an alias for the value
327 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
</span></code>.
</p>
330 <dl class=
"cpp enumerator">
331 <dt id=
"_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_CACHE_LOOKUPSE">
332 <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>
334 <div><div class=
"deprecated">
335 <p><span class=
"versionmodified deprecated">Deprecated since version
0.46(?):
</span>DNS lookups are now always cached until an error occurs with the
339 <p>Memcached can cache named lookups so that DNS lookups are made only once.
</p>
342 <dl class=
"cpp enumerator">
343 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SUPPORT_CASE">
344 <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>
345 <dd><p>Support CAS operations (this is not enabled by default at this point in
346 the server since it imposes a slight performance penalty).
</p>
349 <dl class=
"cpp enumerator">
350 <dt id=
"_CPPv4N20memcached_behavior_t25MEMCACHED_BEHAVIOR_KETAMAE">
351 <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>
352 <dd><p>Sets the default distribution to
353 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
</span></code> and the hash to
354 <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>
357 <dl class=
"cpp enumerator">
358 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_KETAMA_WEIGHTEDE">
359 <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>
360 <dd><p>Sets the default distribution to
361 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
</span></code> with the weighted tests.
362 Makes the default hashing algorithm for keys use
<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>
365 <dl class=
"cpp enumerator">
366 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_KETAMA_HASHE">
367 <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>
368 <dd><p>Sets the hashing algorithm for host mapping on continuum.
</p>
369 <p>The value can be set to either:
</p>
371 <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>
372 <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>
373 <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>
374 <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>
375 <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>
376 <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>
377 <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>
381 <dl class=
"cpp enumerator">
382 <dt id=
"_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_KETAMA_COMPATE">
383 <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>
384 <dd><p>Sets the compatibility mode. The value can be set to either
385 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_KETAMA_COMPAT_LIBMEMCACHED
</span></code> (this is the default) or
386 <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
390 <dl class=
"cpp enumerator">
391 <dt id=
"_CPPv4N20memcached_behavior_t31MEMCACHED_BEHAVIOR_POLL_TIMEOUTE">
392 <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>
393 <dd><p>Modify the timeout in milliseconds value that is used by poll. The
394 default value is -
1. An signed int must be passed to
395 <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).
396 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
397 returned as 'unsigned long long'.
</p>
400 <dl class=
"cpp enumerator">
401 <dt id=
"_CPPv4N20memcached_behavior_t28MEMCACHED_BEHAVIOR_USER_DATAE">
402 <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>
403 <dd><div class=
"deprecated">
404 <p><span class=
"versionmodified deprecated">Deprecated since version
<:
</span>0.30</p>
408 <dl class=
"cpp enumerator">
409 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BUFFER_REQUESTSE">
410 <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>
411 <dd><p>Enabling buffered IO causes commands to
"buffer
" instead of being sent.
412 Any action that gets data causes this buffer to be be sent to the remote
413 connection. Quiting the connection or closing down the connection will
414 also cause the buffered data to be pushed to the remote connection.
</p>
417 <dl class=
"cpp enumerator">
418 <dt id=
"_CPPv4N20memcached_behavior_t29MEMCACHED_BEHAVIOR_VERIFY_KEYE">
419 <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>
420 <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
421 they are valid keys.
</p>
424 <dl class=
"cpp enumerator">
425 <dt id=
"_CPPv4N20memcached_behavior_t29MEMCACHED_BEHAVIOR_SORT_HOSTSE">
426 <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>
427 <dd><p>Enabling this will cause hosts that are added to be placed in the host
428 list in sorted order. This will defeat consistent hashing.
</p>
431 <dl class=
"cpp enumerator">
432 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_CONNECT_TIMEOUTE">
433 <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>
434 <dd><p>In non-blocking mode this changes the value of the timeout during socket
435 connection in milliseconds. Specifying -
1 means an infinite time‐out.
</p>
438 <dl class=
"cpp enumerator">
439 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BINARY_PROTOCOLE">
440 <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>
441 <dd><p>Enable the use of the binary protocol. Please note that you cannot
442 toggle this flag on an open connection.
</p>
445 <dl class=
"cpp enumerator">
446 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_IO_MSG_WATERMARKE">
447 <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>
448 <dd><p>Set this value to tune the number of messages that may be sent before
449 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> should start to automatically drain the input queue.
</p>
450 <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
451 to send data, but the send will block because the input buffer in the
455 <dl class=
"cpp enumerator">
456 <dt id=
"_CPPv4N20memcached_behavior_t37MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARKE">
457 <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>
458 <dd><p>Set this value to tune the number of bytes that may be sent before
459 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> should start to automatically drain the input queue (need
460 at least
10 IO requests sent without reading the input buffer).
</p>
461 <p>Setting this value to high, may cause libmemcached to deadlock (trying
462 to send data, but the send will block because the input buffer in the
466 <dl class=
"cpp enumerator">
467 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_IO_KEY_PREFETCHE">
468 <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>
469 <dd><p>The binary protocol works a bit different than the textual protocol in
470 that a multiget is implemented as a pipe of single get-operations which
471 are sent to the server in a chunk.
</p>
472 <p>If you are using large multigets from your application, you may improve
473 the latency of the gets by setting this value so you send out the first
474 chunk of requests when you hit the specified limit. It allows the
475 servers to start processing the requests to send the data back while the
476 rest of the requests are created and sent to the server.
</p>
479 <dl class=
"cpp enumerator">
480 <dt id=
"_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_NOREPLYE">
481 <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>
482 <dd><p>Set this value to specify that you really don't care about the result
483 from your storage commands (set, add, replace, append, prepend).
</p>
486 <dl class=
"cpp enumerator">
487 <dt id=
"_CPPv4N20memcached_behavior_t37MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICASE">
488 <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>
489 <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
490 (on different servers).
</p>
491 <p>This replication does not dedicate certain memcached servers to store
492 the replicas in, but instead it will store the replicas together with
493 all of the other objects (on the 'n' next servers specified in your
497 <dl class=
"cpp enumerator">
498 <dt id=
"_CPPv4N20memcached_behavior_t41MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READE">
499 <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>
500 <dd><p>Allows randomizing the replica reads starting point. Normally the read
501 is done from primary server and in case of miss the read is done from
502 primary +
1, then primary +
2 all the way to 'n' replicas.
</p>
503 <p>If this option is set on the starting point of the replica reads is
504 randomized between the servers. This allows distributing read load to
505 multiple servers with the expense of more write traffic.
</p>
508 <dl class=
"cpp enumerator">
509 <dt id=
"_CPPv4N20memcached_behavior_t23MEMCACHED_BEHAVIOR_CORKE">
510 <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>
511 <dd><div class=
"deprecated">
512 <p><span class=
"versionmodified deprecated">Deprecated since version ?:
</span>This option has been deprecated with the behavior now built in and
513 used appropriately on selected platforms.
</p>
517 <dl class=
"cpp enumerator">
518 <dt id=
"_CPPv4N20memcached_behavior_t28MEMCACHED_BEHAVIOR_KEEPALIVEE">
519 <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>
520 <dd><p>Enable TCP_KEEPALIVE behavior.
</p>
523 <dl class=
"cpp enumerator">
524 <dt id=
"_CPPv4N20memcached_behavior_t33MEMCACHED_BEHAVIOR_KEEPALIVE_IDLEE">
525 <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>
526 <dd><p>Specify time, in seconds, to mark a connection as idle. This is only
527 available as an option Linux.
</p>
530 <dl class=
"cpp enumerator">
531 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZEE">
532 <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>
533 <dd><p>Find the current size of SO_SNDBUF. A value of
0 means either an error
534 occurred or no hosts were available. It is safe to assume system default
536 <p>If an error occurs you can check the last cached errno to find the
540 <dl class=
"cpp enumerator">
541 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZEE">
542 <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>
543 <dd><p>Find the current size of SO_RCVBUF. A value of
0 means either an error
544 occurred or no hosts were available. It is safe to assume system default
546 <p>If an error occurs you can check the last cached errno to find the
550 <dl class=
"cpp enumerator">
551 <dt id=
"_CPPv4N20memcached_behavior_t39MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMITE">
552 <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>
553 <dd><div class=
"deprecated">
554 <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>
556 <p>Set this value to enable the server be removed after continuous
557 <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>
560 <dl class=
"cpp enumerator">
561 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTSE">
562 <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>
563 <dd><div class=
"deprecated">
564 <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>
566 <p>If enabled any hosts which have been flagged as disabled will be removed
567 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
568 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>
571 <dl class=
"cpp enumerator">
572 <dt id=
"_CPPv4N20memcached_behavior_t40MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERSE">
573 <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>
574 <dd><p>If enabled any hosts which have been flagged as disabled will be removed
575 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>
578 <dl class=
"cpp enumerator">
579 <dt id=
"_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_RETRY_TIMEOUTE">
580 <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>
581 <dd><p>When enabled a host which is problematic will only be checked for usage
582 based on the amount of time set by this behavior. The value is in
586 <dl class=
"cpp enumerator">
587 <dt id=
"_CPPv4N20memcached_behavior_t39MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEYE">
588 <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>
589 <dd><p>When enabled the prefix key will be added to the key when determining
590 server by hash. See
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_CALLBACK_NAMESPACE
</span></code> for additional
597 <div class=
"section" id=
"description">
598 <h2>DESCRIPTION
<a class=
"headerlink" href=
"#description" title=
"Permalink to this headline">¶
</a></h2>
599 <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-any docutils literal notranslate"><span class=
"pre">memcached_behavior_set()
</span></code></a>.
600 Default behavior is the library strives to be quick and accurate. Some behavior,
601 while being faster, can also result in not entirely accurate behavior (for
602 instance,
<a class=
"reference internal" href=
"memcached_set.html#_CPPv413memcached_setP12memcached_stPKc6size_tPKc6size_t6time_t8uint32_t" title=
"memcached_set"><code class=
"xref cpp cpp-any 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>
603 <p><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> takes a behavior
<code class=
"docutils literal notranslate"><span class=
"pre">flag
</span></code> and returns whether or not
604 that behavior is currently enabled in the client.
</p>
605 <p><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> changes the value of a particular option of the client.
606 It takes both a
<code class=
"docutils literal notranslate"><span class=
"pre">flag
</span></code> and a
<code class=
"docutils literal notranslate"><span class=
"pre">value
</span></code>. For simple on or off options you just
607 need to pass in a value of
1. Calls to
<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> will flush and
608 reset all connections.
</p>
610 <div class=
"section" id=
"return-value">
611 <h2>RETURN VALUE
<a class=
"headerlink" href=
"#return-value" title=
"Permalink to this headline">¶
</a></h2>
612 <p><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> returns either the current value of the key, or
0
613 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-any docutils literal notranslate"><span class=
"pre">memcached_behavior_set()
</span></code></a>
614 returns failure or success.
</p>
616 <div class=
"section" id=
"notes">
617 <h2>NOTES
<a class=
"headerlink" href=
"#notes" title=
"Permalink to this headline">¶
</a></h2>
618 <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-any docutils literal notranslate"><span class=
"pre">memcached_behavior_set()
</span></code></a> was changed in version
619 0.17 from taking a pointer to data value, to taking a uin64_t.
</p>
621 <div class=
"section" id=
"see-also">
622 <h2>SEE ALSO
<a class=
"headerlink" href=
"#see-also" title=
"Permalink to this headline">¶
</a></h2>
624 <li><p><em class=
"manpage"><a class=
"manpage reference external" href=
"https://linux.die.net/man/1/memcached">memcached(
1)
</a></em></p></li>
625 <li><p><em class=
"manpage"><a class=
"manpage reference external" href=
"https://linux.die.net/man/3/setsockopt">setsockopt(
3)
</a></em></p></li>
626 <li><p><a class=
"reference internal" href=
"../libmemcached.html"><span class=
"doc">C/C++ Client Library for memcached
</span></a></p></li>
627 <li><p><a class=
"reference internal" href=
"memcached_strerror.html"><span class=
"doc">Converting Error Codes to Messages
</span></a></p></li>
638 <div class=
"rst-footer-buttons" role=
"navigation" aria-label=
"footer navigation">
640 <a href=
"memcached_callback.html" class=
"btn btn-neutral float-right" title=
"Library callbacks" accesskey=
"n" rel=
"next">Next
<span class=
"fa fa-arrow-circle-right"></span></a>
643 <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>
650 <div role=
"contentinfo">
652 © <a href=
"../copyright.html">Copyright
</a>
656 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>.
669 <script type=
"text/javascript">
671 SphinxRtdTheme.Navigation.enable(true);