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-awesome
1.1.4 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 type=
"text/javascript" src=
"../_static/jquery.js"></script>
25 <script type=
"text/javascript" src=
"../_static/underscore.js"></script>
26 <script type=
"text/javascript" src=
"../_static/doctools.js"></script>
27 <script type=
"text/javascript" 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-awesome
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">
89 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libmemcached.html">Introduction
</a></li>
90 <li class=
"toctree-l1 current"><a class=
"reference internal" href=
"index.html">libmemcached API
</a><ul class=
"current">
91 <li class=
"toctree-l2"><a class=
"reference internal" href=
"index_basics.html">Basics
</a></li>
92 <li class=
"toctree-l2"><a class=
"reference internal" href=
"index_data.html">Working with Data
</a></li>
93 <li class=
"toctree-l2"><a class=
"reference internal" href=
"index_errors.html">Messages and Errors
</a></li>
94 <li class=
"toctree-l2 current"><a class=
"reference internal" href=
"index_advanced.html">Advanced Topics
</a><ul class=
"current">
95 <li class=
"toctree-l3 current"><a class=
"reference internal" href=
"index_advanced_internals.html">Internal Behavior
</a><ul class=
"current">
96 <li class=
"toctree-l4 current"><a class=
"current reference internal" href=
"#">Behaviors of the library
</a></li>
97 <li class=
"toctree-l4"><a class=
"reference internal" href=
"memcached_callback.html">Library callbacks
</a></li>
98 <li class=
"toctree-l4"><a class=
"reference internal" href=
"memcached_memory_allocators.html">Use custom allocators for embedded usage
</a></li>
99 <li class=
"toctree-l4"><a class=
"reference internal" href=
"memcached_user_data.html">Storing custom information in the client
</a></li>
102 <li class=
"toctree-l3"><a class=
"reference internal" href=
"index_advanced_aeh.html">Authentication, Encryption
& Hashing
</a></li>
103 <li class=
"toctree-l3"><a class=
"reference internal" href=
"index_advanced_servers.html">Servers and Server Lists
</a></li>
104 <li class=
"toctree-l3"><a class=
"reference internal" href=
"index_advanced_daemon.html">Affecting the memcached Daemon
</a></li>
105 <li class=
"toctree-l3"><a class=
"reference internal" href=
"index_advanced_stats.html">Statistics
</a></li>
108 <li class=
"toctree-l2"><a class=
"reference internal" href=
"index_deprecated.html">Deprecated Functionality
</a></li>
111 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libmemcachedutil/index.html">libmemcachedutil API
</a></li>
112 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libhashkit/index.html">libhashkit API
</a></li>
113 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../bin/index.html">Client Applications
</a></li>
114 <li class=
"toctree-l1"><a class=
"reference internal" href=
"index_misc.html">Miscellaneous
</a></li>
117 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../changelogs.html">Change Logs
</a></li>
118 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../issues.html">Known issues
</a></li>
119 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../copyright.html">Copyright
</a></li>
128 <section data-toggle=
"wy-nav-shift" class=
"wy-nav-content-wrap">
131 <nav class=
"wy-nav-top" aria-label=
"top navigation">
133 <i data-toggle=
"wy-nav-top" class=
"fa fa-bars"></i>
134 <a href=
"../index.html">libmemcached-awesome
</a>
139 <div class=
"wy-nav-content">
141 <div class=
"rst-content">
159 <div role=
"navigation" aria-label=
"breadcrumbs navigation">
161 <ul class=
"wy-breadcrumbs">
163 <li><a href=
"../index.html">Docs
</a> »</li>
165 <li><a href=
"index.html">libmemcached API
</a> »</li>
167 <li><a href=
"index_advanced.html">Advanced Topics
</a> »</li>
169 <li><a href=
"index_advanced_internals.html">Internal Behavior
</a> »</li>
171 <li>Behaviors of the library
</li>
174 <li class=
"wy-breadcrumbs-aside">
178 <a href=
"https://github.com/awesomized/libmemcached/blob/v1.x/docs/source/libmemcached/memcached_behavior.rst" class=
"fa fa-github"> Edit on GitHub
</a>
189 <div role=
"main" class=
"document" itemscope=
"itemscope" itemtype=
"http://schema.org/Article">
190 <div itemprop=
"articleBody">
192 <div class=
"section" id=
"behaviors-of-the-library">
193 <h1>Behaviors of the library
<a class=
"headerlink" href=
"#behaviors-of-the-library" title=
"Permalink to this headline">¶
</a></h1>
194 <p>Manipulate the behavior of a memcached_st structure.
</p>
195 <div class=
"section" id=
"synopsis">
196 <h2>SYNOPSIS
<a class=
"headerlink" href=
"#synopsis" title=
"Permalink to this headline">¶
</a></h2>
197 <dl class=
"docutils">
198 <dt>#include
<libmemcached/memcached.h
></dt>
199 <dd>Compile and link with -lmemcached
</dd>
201 <dl class=
"function">
202 <dt id=
"_CPPv422memcached_behavior_getP12memcached_st20memcached_behavior_t">
203 <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=
"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>
204 <dd><table class=
"docutils field-list" frame=
"void" rules=
"none">
205 <col class=
"field-name" />
206 <col class=
"field-body" />
208 <tr class=
"field-odd field"><th class=
"field-name">Parameters:
</th><td class=
"field-body"><ul class=
"first simple">
209 <li><strong>ptr
</strong> -- pointer to initialized
<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> struct
</li>
210 <li><strong>flag
</strong> --
<a class=
"reference internal" href=
"#_CPPv420memcached_behavior_t" title=
"memcached_behavior_t"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_behavior_t
</span></code></a> to query
</li>
214 <tr class=
"field-even field"><th class=
"field-name">Returns:
</th><td class=
"field-body"><p class=
"first last">the vaue set for
<a class=
"reference internal" href=
"#_CPPv422memcached_behavior_getP12memcached_st20memcached_behavior_t" title=
"memcached_behavior_get::flag"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">flag
</span></code></a></p>
221 <dl class=
"function">
222 <dt id=
"_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t">
223 <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=
"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>
224 <dd><table class=
"docutils field-list" frame=
"void" rules=
"none">
225 <col class=
"field-name" />
226 <col class=
"field-body" />
228 <tr class=
"field-odd field"><th class=
"field-name">Parameters:
</th><td class=
"field-body"><ul class=
"first simple">
229 <li><strong>ptr
</strong> -- pointer to initialized
<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> struct
</li>
230 <li><strong>flag
</strong> --
<a class=
"reference internal" href=
"#_CPPv420memcached_behavior_t" title=
"memcached_behavior_t"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_behavior_t
</span></code></a> to set
</li>
231 <li><strong>data
</strong> -- the value to set for
<a class=
"reference internal" href=
"#_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t" title=
"memcached_behavior_set::flag"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">flag
</span></code></a></li>
235 <tr class=
"field-even field"><th class=
"field-name">Returns:
</th><td class=
"field-body"><p class=
"first last"><a class=
"reference internal" href=
"memcached_return_t.html#_CPPv418memcached_return_t" title=
"memcached_return_t"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_return_t
</span></code></a> indicating success
</p>
240 <div class=
"versionchanged">
241 <p><span class=
"versionmodified">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
242 from taking a pointer to data value, to taking a uin64_t.
</p>
247 <dt id=
"c.memcached_behavior_t">
248 enum
<a class=
"reference internal" href=
"#c.memcached_behavior_t" title=
"memcached_behavior_t">memcached_behavior_t
</a> <code class=
"descname">memcached_behavior_t
</code><a class=
"headerlink" href=
"#c.memcached_behavior_t" title=
"Permalink to this definition">¶
</a></dt>
252 <dt id=
"_CPPv420memcached_behavior_t">
253 <span id=
"_CPPv320memcached_behavior_t"></span><span id=
"_CPPv220memcached_behavior_t"></span><em class=
"property">enum
</em><code class=
"descname">memcached_behavior_t
</code><a class=
"headerlink" href=
"#_CPPv420memcached_behavior_t" title=
"Permalink to this definition">¶
</a><br /></dt>
254 <dd><dl class=
"enumerator">
255 <dt id=
"_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_USE_UDPE">
256 <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=
"descname">MEMCACHED_BEHAVIOR_USE_UDP
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_USE_UDPE" title=
"Permalink to this definition">¶
</a><br /></dt>
257 <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
258 memcached server. Not all I/O operations are tested when this behavior
260 <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
261 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>
263 <li><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>,
</li>
264 <li><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>,
</li>
265 <li><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>,
</li>
266 <li><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>,
</li>
267 <li><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>,
</li>
268 <li><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>,
</li>
269 <li><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>,
</li>
270 <li><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>,
</li>
271 <li><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>.
</li>
273 <p>All other operations are tested but are executed in a 'fire-and-forget'
274 mode, in which once the client has executed the operation, no attempt
275 will be made to ensure the operation has been received and acted on by
277 <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
278 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
279 server when this behavior is enabled will result in a
280 <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
281 server when this behavior has not been enabled.
</p>
284 <dl class=
"enumerator">
285 <dt id=
"_CPPv4N20memcached_behavior_t27MEMCACHED_BEHAVIOR_NO_BLOCKE">
286 <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=
"descname">MEMCACHED_BEHAVIOR_NO_BLOCK
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t27MEMCACHED_BEHAVIOR_NO_BLOCKE" title=
"Permalink to this definition">¶
</a><br /></dt>
287 <dd><p>This enables
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">SO_LINGER
</span></code> only, so the
<em class=
"manpage"><a class=
"manpage reference external" href=
"https://linux.die.net/man/2/close">close(
2)
</a></em> call on the
288 socket returns immediately. I/O is always handled asynchronously in
289 recent versions of
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code>.
</p>
292 <dl class=
"enumerator">
293 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SND_TIMEOUTE">
294 <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=
"descname">MEMCACHED_BEHAVIOR_SND_TIMEOUT
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SND_TIMEOUTE" title=
"Permalink to this definition">¶
</a><br /></dt>
295 <dd><p>This sets the microsecond behavior of the socket against the SO_SNDTIMEO
299 <dl class=
"enumerator">
300 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_RCV_TIMEOUTE">
301 <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=
"descname">MEMCACHED_BEHAVIOR_RCV_TIMEOUT
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_RCV_TIMEOUTE" title=
"Permalink to this definition">¶
</a><br /></dt>
302 <dd><p>This sets the microsecond behavior of the socket against the SO_RCVTIMEO
306 <dl class=
"enumerator">
307 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_TCP_NODELAYE">
308 <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=
"descname">MEMCACHED_BEHAVIOR_TCP_NODELAY
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_TCP_NODELAYE" title=
"Permalink to this definition">¶
</a><br /></dt>
309 <dd><p>Disables Nagle's algorithm.
310 See
<a class=
"reference external" href=
"https://tools.ietf.org/html/rfc896">RFC
896</a>.
</p>
313 <dl class=
"enumerator">
314 <dt id=
"_CPPv4N20memcached_behavior_t23MEMCACHED_BEHAVIOR_HASHE">
315 <span id=
"_CPPv3N20memcached_behavior_t23MEMCACHED_BEHAVIOR_HASHE"></span><span id=
"_CPPv2N20memcached_behavior_t23MEMCACHED_BEHAVIOR_HASHE"></span><em class=
"property">enumerator
</em><code class=
"descname">MEMCACHED_BEHAVIOR_HASH
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t23MEMCACHED_BEHAVIOR_HASHE" title=
"Permalink to this definition">¶
</a><br /></dt>
316 <dd><p>Set the
<a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv416memcached_hash_t" title=
"memcached_hash_t"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">hash
</span> <span class=
"pre">algorithm
</span></code></a> used for keys.
</p>
317 <p>Each hash has its advantages and its weaknesses. If you don't know or
318 don't care, just go with the default.
</p>
321 <dl class=
"enumerator">
322 <dt id=
"_CPPv4N20memcached_behavior_t31MEMCACHED_BEHAVIOR_DISTRIBUTIONE">
323 <span id=
"_CPPv3N20memcached_behavior_t31MEMCACHED_BEHAVIOR_DISTRIBUTIONE"></span><span id=
"_CPPv2N20memcached_behavior_t31MEMCACHED_BEHAVIOR_DISTRIBUTIONE"></span><em class=
"property">enumerator
</em><code class=
"descname">MEMCACHED_BEHAVIOR_DISTRIBUTION
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t31MEMCACHED_BEHAVIOR_DISTRIBUTIONE" title=
"Permalink to this definition">¶
</a><br /></dt>
324 <dd><p>Setting a
<a class=
"reference internal" href=
"#_CPPv431memcached_server_distribution_t" title=
"memcached_server_distribution_t"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_server_distribution_t
</span></code></a> you can enable different
325 means of distributing values to servers.
</p>
326 <p>The default method is
<a class=
"reference internal" href=
"#_CPPv4N31memcached_server_distribution_t29MEMCACHED_DISTRIBUTION_MODULAE" title=
"MEMCACHED_DISTRIBUTION_MODULA"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_MODULA
</span></code></a> (hash of the
327 key modulo number of servers).
</p>
328 <p>You can enable consistent hashing by setting
329 <a class=
"reference internal" href=
"#_CPPv4N31memcached_server_distribution_t33MEMCACHED_DISTRIBUTION_CONSISTENTE" title=
"MEMCACHED_DISTRIBUTION_CONSISTENT"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT
</span></code></a>. Consistent hashing delivers better
330 distribution and allows servers to be added to the cluster with minimal
332 <p>Currently
<a class=
"reference internal" href=
"#_CPPv4N31memcached_server_distribution_t33MEMCACHED_DISTRIBUTION_CONSISTENTE" title=
"MEMCACHED_DISTRIBUTION_CONSISTENT"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT
</span></code></a> is an alias for the value
333 <a class=
"reference internal" href=
"#_CPPv4N31memcached_server_distribution_t40MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMAE" title=
"MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
</span></code></a>.
</p>
336 <dl class=
"enumerator">
337 <dt id=
"_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_CACHE_LOOKUPSE">
338 <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=
"descname">MEMCACHED_BEHAVIOR_CACHE_LOOKUPS
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_CACHE_LOOKUPSE" title=
"Permalink to this definition">¶
</a><br /></dt>
340 <div><div class=
"deprecated">
341 <p><span class=
"versionmodified">Deprecated since version
0.46(?):
</span>DNS lookups are now always cached until an error occurs with the
345 <p>Memcached can cache named lookups so that DNS lookups are made only once.
</p>
348 <dl class=
"enumerator">
349 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SUPPORT_CASE">
350 <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=
"descname">MEMCACHED_BEHAVIOR_SUPPORT_CAS
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SUPPORT_CASE" title=
"Permalink to this definition">¶
</a><br /></dt>
351 <dd><p>Support CAS operations (this is not enabled by default at this point in
352 the server since it imposes a slight performance penalty).
</p>
355 <dl class=
"enumerator">
356 <dt id=
"_CPPv4N20memcached_behavior_t25MEMCACHED_BEHAVIOR_KETAMAE">
357 <span id=
"_CPPv3N20memcached_behavior_t25MEMCACHED_BEHAVIOR_KETAMAE"></span><span id=
"_CPPv2N20memcached_behavior_t25MEMCACHED_BEHAVIOR_KETAMAE"></span><em class=
"property">enumerator
</em><code class=
"descname">MEMCACHED_BEHAVIOR_KETAMA
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t25MEMCACHED_BEHAVIOR_KETAMAE" title=
"Permalink to this definition">¶
</a><br /></dt>
358 <dd><p>Sets the default distribution to
359 <a class=
"reference internal" href=
"#_CPPv4N31memcached_server_distribution_t40MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMAE" title=
"MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
</span></code></a> and the hash to
360 <a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv4N16memcached_hash_t18MEMCACHED_HASH_MD5E" title=
"MEMCACHED_HASH_MD5"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_MD5
</span></code></a>.
</p>
363 <dl class=
"enumerator">
364 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_KETAMA_WEIGHTEDE">
365 <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=
"descname">MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_KETAMA_WEIGHTEDE" title=
"Permalink to this definition">¶
</a><br /></dt>
366 <dd><p>Sets the default distribution to
367 <a class=
"reference internal" href=
"#_CPPv4N31memcached_server_distribution_t40MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMAE" title=
"MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
</span></code></a> with the weighted tests.
368 Makes the default hashing algorithm for keys use
<a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv4N16memcached_hash_t18MEMCACHED_HASH_MD5E" title=
"MEMCACHED_HASH_MD5"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_HASH_MD5
</span></code></a>.
</p>
371 <dl class=
"enumerator">
372 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_KETAMA_HASHE">
373 <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=
"descname">MEMCACHED_BEHAVIOR_KETAMA_HASH
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_KETAMA_HASHE" title=
"Permalink to this definition">¶
</a><br /></dt>
374 <dd><p>Sets the
<a class=
"reference internal" href=
"memcached_generate_hash_value.html#_CPPv416memcached_hash_t" title=
"memcached_hash_t"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">hashing
</span> <span class=
"pre">algorithm
</span></code></a> for host mapping on continuum.
</p>
377 <dl class=
"enumerator">
378 <dt id=
"_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_KETAMA_COMPATE">
379 <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=
"descname">MEMCACHED_BEHAVIOR_KETAMA_COMPAT
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_KETAMA_COMPATE" title=
"Permalink to this definition">¶
</a><br /></dt>
380 <dd><p>Sets the compatibility mode. The value can be set to either
381 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_KETAMA_COMPAT_LIBMEMCACHED
</span></code> (this is the default) or
382 <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
386 <dl class=
"enumerator">
387 <dt id=
"_CPPv4N20memcached_behavior_t31MEMCACHED_BEHAVIOR_POLL_TIMEOUTE">
388 <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=
"descname">MEMCACHED_BEHAVIOR_POLL_TIMEOUT
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t31MEMCACHED_BEHAVIOR_POLL_TIMEOUTE" title=
"Permalink to this definition">¶
</a><br /></dt>
389 <dd><p>Modify the timeout in milliseconds value that is used by poll. The
390 default value is -
1. An signed int must be passed to
391 <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).
392 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
393 returned as 'unsigned long long'.
</p>
396 <dl class=
"enumerator">
397 <dt id=
"_CPPv4N20memcached_behavior_t28MEMCACHED_BEHAVIOR_USER_DATAE">
398 <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=
"descname">MEMCACHED_BEHAVIOR_USER_DATA
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t28MEMCACHED_BEHAVIOR_USER_DATAE" title=
"Permalink to this definition">¶
</a><br /></dt>
399 <dd><div class=
"deprecated">
400 <p><span class=
"versionmodified">Deprecated since version
<:
</span>0.30</p>
404 <dl class=
"enumerator">
405 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BUFFER_REQUESTSE">
406 <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=
"descname">MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BUFFER_REQUESTSE" title=
"Permalink to this definition">¶
</a><br /></dt>
407 <dd><p>Enabling buffered IO causes commands to
"buffer
" instead of being sent.
408 Any action that gets data causes this buffer to be be sent to the remote
409 connection. Quiting the connection or closing down the connection will
410 also cause the buffered data to be pushed to the remote connection.
</p>
413 <dl class=
"enumerator">
414 <dt id=
"_CPPv4N20memcached_behavior_t29MEMCACHED_BEHAVIOR_VERIFY_KEYE">
415 <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=
"descname">MEMCACHED_BEHAVIOR_VERIFY_KEY
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t29MEMCACHED_BEHAVIOR_VERIFY_KEYE" title=
"Permalink to this definition">¶
</a><br /></dt>
416 <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
417 they are valid keys.
</p>
420 <dl class=
"enumerator">
421 <dt id=
"_CPPv4N20memcached_behavior_t29MEMCACHED_BEHAVIOR_SORT_HOSTSE">
422 <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=
"descname">MEMCACHED_BEHAVIOR_SORT_HOSTS
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t29MEMCACHED_BEHAVIOR_SORT_HOSTSE" title=
"Permalink to this definition">¶
</a><br /></dt>
423 <dd><p>Enabling this will cause hosts that are added to be placed in the host
424 list in sorted order. This will defeat consistent hashing.
</p>
427 <dl class=
"enumerator">
428 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_CONNECT_TIMEOUTE">
429 <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=
"descname">MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_CONNECT_TIMEOUTE" title=
"Permalink to this definition">¶
</a><br /></dt>
430 <dd><p>Set the timeout during socket connection in milliseconds.
431 Specifying -
1 means an infinite time‐out.
</p>
434 <dl class=
"enumerator">
435 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BINARY_PROTOCOLE">
436 <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=
"descname">MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BINARY_PROTOCOLE" title=
"Permalink to this definition">¶
</a><br /></dt>
437 <dd><p>Enable the use of the binary protocol. Please note that you cannot
438 toggle this flag on an open connection.
</p>
441 <dl class=
"enumerator">
442 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_IO_MSG_WATERMARKE">
443 <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=
"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>
444 <dd><p>Set this value to tune the number of messages that may be sent before
445 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> should start to automatically drain the input queue.
</p>
446 <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
447 to send data, but the send will block because the input buffer in the
451 <dl class=
"enumerator">
452 <dt id=
"_CPPv4N20memcached_behavior_t37MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARKE">
453 <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=
"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>
454 <dd><p>Set this value to tune the number of bytes that may be sent before
455 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> should start to automatically drain the input queue (need
456 at least
10 IO requests sent without reading the input buffer).
</p>
457 <p>Setting this value to high, may cause libmemcached to deadlock (trying
458 to send data, but the send will block because the input buffer in the
462 <dl class=
"enumerator">
463 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_IO_KEY_PREFETCHE">
464 <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=
"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>
465 <dd><p>The binary protocol works a bit different than the textual protocol in
466 that a multiget is implemented as a pipe of single get-operations which
467 are sent to the server in a chunk.
</p>
468 <p>If you are using large multigets from your application, you may improve
469 the latency of the gets by setting this value so you send out the first
470 chunk of requests when you hit the specified limit. It allows the
471 servers to start processing the requests to send the data back while the
472 rest of the requests are created and sent to the server.
</p>
475 <dl class=
"enumerator">
476 <dt id=
"_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_NOREPLYE">
477 <span id=
"_CPPv3N20memcached_behavior_t26MEMCACHED_BEHAVIOR_NOREPLYE"></span><span id=
"_CPPv2N20memcached_behavior_t26MEMCACHED_BEHAVIOR_NOREPLYE"></span><em class=
"property">enumerator
</em><code class=
"descname">MEMCACHED_BEHAVIOR_NOREPLY
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_NOREPLYE" title=
"Permalink to this definition">¶
</a><br /></dt>
478 <dd><p>Set this value to specify that you really don't care about the result
479 from your storage commands (set, add, replace, append, prepend).
</p>
482 <dl class=
"enumerator">
483 <dt id=
"_CPPv4N20memcached_behavior_t37MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICASE">
484 <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=
"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>
485 <dd><p>Specify the number of replicas
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> should store of each item
486 (on different servers).
</p>
487 <p>This replication does not dedicate certain memcached servers to store
488 the replicas in, but instead it will store the replicas together with
489 all of the other objects (on the 'n' next servers specified in your
491 <p>Requires the binary protocol and only supports (M)GET/SET/DELETE.
</p>
492 <p><strong>NOTE
</strong>:
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> does not guarantee nor enforce any consistency.
</p>
495 <dl class=
"enumerator">
496 <dt id=
"_CPPv4N20memcached_behavior_t41MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READE">
497 <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=
"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>
498 <dd><p>Allows randomizing the replica reads starting point. Normally the read
499 is done from primary server and in case of failure the read is done from
500 primary +
1, then primary +
2 all the way to 'n' replicas.
</p>
501 <p>This allows distributing read load to multiple servers with the expense
502 of more write traffic.
</p>
503 <p><strong>NOTE
</strong>: Only errors to communicate with a server are considered
504 failures, so
<a class=
"reference internal" href=
"memcached_return_t.html#_CPPv4N18memcached_return_t18MEMCACHED_NOTFOUNDE" title=
"MEMCACHED_NOTFOUND"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_NOTFOUND
</span></code></a> does
<em>not
</em> account for failure.
</p>
507 <dl class=
"enumerator">
508 <dt id=
"_CPPv4N20memcached_behavior_t23MEMCACHED_BEHAVIOR_CORKE">
509 <span id=
"_CPPv3N20memcached_behavior_t23MEMCACHED_BEHAVIOR_CORKE"></span><span id=
"_CPPv2N20memcached_behavior_t23MEMCACHED_BEHAVIOR_CORKE"></span><em class=
"property">enumerator
</em><code class=
"descname">MEMCACHED_BEHAVIOR_CORK
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t23MEMCACHED_BEHAVIOR_CORKE" title=
"Permalink to this definition">¶
</a><br /></dt>
510 <dd><div class=
"deprecated">
511 <p><span class=
"versionmodified">Deprecated since version ?:
</span>This option has been deprecated with the behavior now built in and
512 used appropriately on selected platforms.
</p>
516 <dl class=
"enumerator">
517 <dt id=
"_CPPv4N20memcached_behavior_t28MEMCACHED_BEHAVIOR_KEEPALIVEE">
518 <span id=
"_CPPv3N20memcached_behavior_t28MEMCACHED_BEHAVIOR_KEEPALIVEE"></span><span id=
"_CPPv2N20memcached_behavior_t28MEMCACHED_BEHAVIOR_KEEPALIVEE"></span><em class=
"property">enumerator
</em><code class=
"descname">MEMCACHED_BEHAVIOR_KEEPALIVE
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t28MEMCACHED_BEHAVIOR_KEEPALIVEE" title=
"Permalink to this definition">¶
</a><br /></dt>
519 <dd><p>Enable TCP_KEEPALIVE behavior.
</p>
522 <dl class=
"enumerator">
523 <dt id=
"_CPPv4N20memcached_behavior_t33MEMCACHED_BEHAVIOR_KEEPALIVE_IDLEE">
524 <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=
"descname">MEMCACHED_BEHAVIOR_KEEPALIVE_IDLE
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t33MEMCACHED_BEHAVIOR_KEEPALIVE_IDLEE" title=
"Permalink to this definition">¶
</a><br /></dt>
525 <dd><p>Specify time, in seconds, to mark a connection as idle. This is only
526 available as an option on Linux.
</p>
529 <dl class=
"enumerator">
530 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZEE">
531 <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=
"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>
532 <dd><p>Find the current size of SO_SNDBUF. A value of
0 means either an error
533 occurred or no hosts were available. It is safe to assume system default
535 <p>If an error occurs you can check the last cached errno to find the
539 <dl class=
"enumerator">
540 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZEE">
541 <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=
"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>
542 <dd><p>Find the current size of SO_RCVBUF. A value of
0 means either an error
543 occurred or no hosts were available. It is safe to assume system default
545 <p>If an error occurs you can check the last cached errno to find the
549 <dl class=
"enumerator">
550 <dt id=
"_CPPv4N20memcached_behavior_t39MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMITE">
551 <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=
"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>
552 <dd><div class=
"deprecated">
553 <p><span class=
"versionmodified">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>
555 <p>Set this value to enable the server be removed after continuous
556 <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>
559 <dl class=
"enumerator">
560 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTSE">
561 <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=
"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>
562 <dd><div class=
"deprecated">
563 <p><span class=
"versionmodified">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>
565 <p>If enabled any hosts which have been flagged as disabled will be removed
566 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
567 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>
570 <dl class=
"enumerator">
571 <dt id=
"_CPPv4N20memcached_behavior_t40MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERSE">
572 <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=
"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>
573 <dd><p>If enabled any hosts which have been flagged as disabled will be removed
574 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>
577 <dl class=
"enumerator">
578 <dt id=
"_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_RETRY_TIMEOUTE">
579 <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=
"descname">MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
</code><a class=
"headerlink" href=
"#_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_RETRY_TIMEOUTE" title=
"Permalink to this definition">¶
</a><br /></dt>
580 <dd><p>When enabled a host which is problematic will only be checked for usage
581 based on the amount of time set by this behavior. The value is in
585 <dl class=
"enumerator">
586 <dt id=
"_CPPv4N20memcached_behavior_t39MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEYE">
587 <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=
"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>
588 <dd><p>When enabled the prefix key will be added to the key when determining
589 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
596 <dt id=
"c.memcached_server_distribution_t">
597 enum
<a class=
"reference internal" href=
"#c.memcached_server_distribution_t" title=
"memcached_server_distribution_t">memcached_server_distribution_t
</a> <code class=
"descname">memcached_server_distribution_t
</code><a class=
"headerlink" href=
"#c.memcached_server_distribution_t" title=
"Permalink to this definition">¶
</a></dt>
601 <dt id=
"_CPPv431memcached_server_distribution_t">
602 <span id=
"_CPPv331memcached_server_distribution_t"></span><span id=
"_CPPv231memcached_server_distribution_t"></span><em class=
"property">enum
</em><code class=
"descname">memcached_server_distribution_t
</code><a class=
"headerlink" href=
"#_CPPv431memcached_server_distribution_t" title=
"Permalink to this definition">¶
</a><br /></dt>
603 <dd><dl class=
"enumerator">
604 <dt id=
"_CPPv4N31memcached_server_distribution_t29MEMCACHED_DISTRIBUTION_MODULAE">
605 <span id=
"_CPPv3N31memcached_server_distribution_t29MEMCACHED_DISTRIBUTION_MODULAE"></span><span id=
"_CPPv2N31memcached_server_distribution_t29MEMCACHED_DISTRIBUTION_MODULAE"></span><em class=
"property">enumerator
</em><code class=
"descname">MEMCACHED_DISTRIBUTION_MODULA
</code><a class=
"headerlink" href=
"#_CPPv4N31memcached_server_distribution_t29MEMCACHED_DISTRIBUTION_MODULAE" title=
"Permalink to this definition">¶
</a><br /></dt>
606 <dd><p>Distribute keys by hash modulo number of servers.
</p>
609 <dl class=
"enumerator">
610 <dt id=
"_CPPv4N31memcached_server_distribution_t33MEMCACHED_DISTRIBUTION_CONSISTENTE">
611 <span id=
"_CPPv3N31memcached_server_distribution_t33MEMCACHED_DISTRIBUTION_CONSISTENTE"></span><span id=
"_CPPv2N31memcached_server_distribution_t33MEMCACHED_DISTRIBUTION_CONSISTENTE"></span><em class=
"property">enumerator
</em><code class=
"descname">MEMCACHED_DISTRIBUTION_CONSISTENT
</code><a class=
"headerlink" href=
"#_CPPv4N31memcached_server_distribution_t33MEMCACHED_DISTRIBUTION_CONSISTENTE" title=
"Permalink to this definition">¶
</a><br /></dt>
612 <dd><p>Alias for
<a class=
"reference internal" href=
"#_CPPv4N31memcached_server_distribution_t40MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMAE" title=
"memcached_server_distribution_t::MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
</span></code></a>.
</p>
615 <dl class=
"enumerator">
616 <dt id=
"_CPPv4N31memcached_server_distribution_t40MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMAE">
617 <span id=
"_CPPv3N31memcached_server_distribution_t40MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMAE"></span><span id=
"_CPPv2N31memcached_server_distribution_t40MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMAE"></span><em class=
"property">enumerator
</em><code class=
"descname">MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
</code><a class=
"headerlink" href=
"#_CPPv4N31memcached_server_distribution_t40MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMAE" title=
"Permalink to this definition">¶
</a><br /></dt>
618 <dd><p>Unweighted consistent key distribution.
</p>
621 <dl class=
"enumerator">
622 <dt id=
"_CPPv4N31memcached_server_distribution_t29MEMCACHED_DISTRIBUTION_RANDOME">
623 <span id=
"_CPPv3N31memcached_server_distribution_t29MEMCACHED_DISTRIBUTION_RANDOME"></span><span id=
"_CPPv2N31memcached_server_distribution_t29MEMCACHED_DISTRIBUTION_RANDOME"></span><em class=
"property">enumerator
</em><code class=
"descname">MEMCACHED_DISTRIBUTION_RANDOM
</code><a class=
"headerlink" href=
"#_CPPv4N31memcached_server_distribution_t29MEMCACHED_DISTRIBUTION_RANDOME" title=
"Permalink to this definition">¶
</a><br /></dt>
624 <dd><p>Distribute keys by
<em class=
"manpage"><a class=
"manpage reference external" href=
"https://linux.die.net/man/3/rand">rand(
3)
</a></em> modulo number of servers.
</p>
627 <dl class=
"enumerator">
628 <dt id=
"_CPPv4N31memcached_server_distribution_t44MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPYE">
629 <span id=
"_CPPv3N31memcached_server_distribution_t44MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPYE"></span><span id=
"_CPPv2N31memcached_server_distribution_t44MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPYE"></span><em class=
"property">enumerator
</em><code class=
"descname">MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY
</code><a class=
"headerlink" href=
"#_CPPv4N31memcached_server_distribution_t44MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPYE" title=
"Permalink to this definition">¶
</a><br /></dt>
630 <dd><p>Unweighted consistent key distribution compatible with the SPY client.
</p>
633 <dl class=
"enumerator">
634 <dt id=
"_CPPv4N31memcached_server_distribution_t42MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTEDE">
635 <span id=
"_CPPv3N31memcached_server_distribution_t42MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTEDE"></span><span id=
"_CPPv2N31memcached_server_distribution_t42MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTEDE"></span><em class=
"property">enumerator
</em><code class=
"descname">MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTED
</code><a class=
"headerlink" href=
"#_CPPv4N31memcached_server_distribution_t42MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTEDE" title=
"Permalink to this definition">¶
</a><br /></dt>
636 <dd><p>Weighted consistent key distribution.
</p>
639 <dl class=
"enumerator">
640 <dt id=
"_CPPv4N31memcached_server_distribution_t37MEMCACHED_DISTRIBUTION_VIRTUAL_BUCKETE">
641 <span id=
"_CPPv3N31memcached_server_distribution_t37MEMCACHED_DISTRIBUTION_VIRTUAL_BUCKETE"></span><span id=
"_CPPv2N31memcached_server_distribution_t37MEMCACHED_DISTRIBUTION_VIRTUAL_BUCKETE"></span><em class=
"property">enumerator
</em><code class=
"descname">MEMCACHED_DISTRIBUTION_VIRTUAL_BUCKET
</code><a class=
"headerlink" href=
"#_CPPv4N31memcached_server_distribution_t37MEMCACHED_DISTRIBUTION_VIRTUAL_BUCKETE" title=
"Permalink to this definition">¶
</a><br /></dt>
642 <dd><p>Consistent key distribution by virtual buckets.
</p>
648 <div class=
"section" id=
"description">
649 <h2>DESCRIPTION
<a class=
"headerlink" href=
"#description" title=
"Permalink to this headline">¶
</a></h2>
650 <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>.
651 Default behavior is the library strives to be quick and accurate. Some behavior,
652 while being faster, can also result in not entirely accurate behavior (for
653 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>
654 <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
655 that behavior is currently enabled in the client.
</p>
656 <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.
657 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
658 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
659 reset all connections.
</p>
661 <div class=
"section" id=
"return-value">
662 <h2>RETURN VALUE
<a class=
"headerlink" href=
"#return-value" title=
"Permalink to this headline">¶
</a></h2>
663 <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
664 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>
665 returns failure or success.
</p>
667 <div class=
"section" id=
"notes">
668 <h2>NOTES
<a class=
"headerlink" href=
"#notes" title=
"Permalink to this headline">¶
</a></h2>
669 <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
670 0.17 from taking a pointer to data value, to taking a uin64_t.
</p>
672 <div class=
"section" id=
"see-also">
673 <h2>SEE ALSO
<a class=
"headerlink" href=
"#see-also" title=
"Permalink to this headline">¶
</a></h2>
675 <li><em class=
"manpage"><a class=
"manpage reference external" href=
"https://linux.die.net/man/1/memcached">memcached(
1)
</a></em></li>
676 <li><em class=
"manpage"><a class=
"manpage reference external" href=
"https://linux.die.net/man/3/setsockopt">setsockopt(
3)
</a></em></li>
677 <li><a class=
"reference internal" href=
"../libmemcached.html"><span class=
"doc">C/C++ Client Library for memcached
</span></a></li>
678 <li><a class=
"reference internal" href=
"memcached_strerror.html"><span class=
"doc">Converting Error Codes to Messages
</span></a></li>
689 <div class=
"rst-footer-buttons" role=
"navigation" aria-label=
"footer navigation">
691 <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>
694 <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>
701 <div role=
"contentinfo">
703 © <a href=
"../copyright.html">Copyright
</a>
707 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>.
720 <script type=
"text/javascript">
722 SphinxRtdTheme.Navigation.enable(true);