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.1.0 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
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=
"../copyright.html">Copyright
</a></li>
127 <section data-toggle=
"wy-nav-shift" class=
"wy-nav-content-wrap">
130 <nav class=
"wy-nav-top" aria-label=
"top navigation">
132 <i data-toggle=
"wy-nav-top" class=
"fa fa-bars"></i>
133 <a href=
"../index.html">libmemcached
</a>
138 <div class=
"wy-nav-content">
140 <div class=
"rst-content">
158 <div role=
"navigation" aria-label=
"breadcrumbs navigation">
160 <ul class=
"wy-breadcrumbs">
162 <li><a href=
"../index.html">Docs
</a> »</li>
164 <li><a href=
"index.html">libmemcached API
</a> »</li>
166 <li><a href=
"index_advanced.html">Advanced Topics
</a> »</li>
168 <li><a href=
"index_advanced_internals.html">Internal Behavior
</a> »</li>
170 <li>Behaviors of the library
</li>
173 <li class=
"wy-breadcrumbs-aside">
177 <a href=
"https://github.com/m6w6/libmemcached/blob/v1.x/docs/source/libmemcached/memcached_behavior.rst" class=
"fa fa-github"> Edit on GitHub
</a>
188 <div role=
"main" class=
"document" itemscope=
"itemscope" itemtype=
"http://schema.org/Article">
189 <div itemprop=
"articleBody">
191 <div class=
"section" id=
"behaviors-of-the-library">
192 <h1>Behaviors of the library
<a class=
"headerlink" href=
"#behaviors-of-the-library" title=
"Permalink to this headline">¶
</a></h1>
193 <p>Manipulate the behavior of a memcached_st structure.
</p>
194 <div class=
"section" id=
"synopsis">
195 <h2>SYNOPSIS
<a class=
"headerlink" href=
"#synopsis" title=
"Permalink to this headline">¶
</a></h2>
196 <dl class=
"docutils">
197 <dt>#include
<libmemcached/memcached.h
></dt>
198 <dd>Compile and link with -lmemcached
</dd>
200 <dl class=
"function">
201 <dt id=
"_CPPv422memcached_behavior_getP12memcached_st20memcached_behavior_t">
202 <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>
203 <dd><table class=
"docutils field-list" frame=
"void" rules=
"none">
204 <col class=
"field-name" />
205 <col class=
"field-body" />
207 <tr class=
"field-odd field"><th class=
"field-name">Parameters:
</th><td class=
"field-body"><ul class=
"first simple">
208 <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>
209 <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>
213 <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>
220 <dl class=
"function">
221 <dt id=
"_CPPv422memcached_behavior_setP12memcached_st20memcached_behavior_t8uint64_t">
222 <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>
223 <dd><table class=
"docutils field-list" frame=
"void" rules=
"none">
224 <col class=
"field-name" />
225 <col class=
"field-body" />
227 <tr class=
"field-odd field"><th class=
"field-name">Parameters:
</th><td class=
"field-body"><ul class=
"first simple">
228 <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>
229 <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>
230 <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>
234 <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>
239 <div class=
"versionchanged">
240 <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
241 from taking a pointer to data value, to taking a uin64_t.
</p>
246 <dt id=
"c.memcached_behavior_t">
247 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>
251 <dt id=
"_CPPv420memcached_behavior_t">
252 <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>
253 <dd><dl class=
"enumerator">
254 <dt id=
"_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_USE_UDPE">
255 <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>
256 <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
257 memcached server. Not all I/O operations are tested when this behavior
259 <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
260 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>
262 <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>
263 <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>
264 <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>
265 <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>
266 <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>
267 <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>
268 <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>
269 <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>
270 <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>
272 <p>All other operations are tested but are executed in a 'fire-and-forget'
273 mode, in which once the client has executed the operation, no attempt
274 will be made to ensure the operation has been received and acted on by
276 <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
277 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
278 server when this behavior is enabled will result in a
279 <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
280 server when this behavior has not been enabled.
</p>
283 <dl class=
"enumerator">
284 <dt id=
"_CPPv4N20memcached_behavior_t27MEMCACHED_BEHAVIOR_NO_BLOCKE">
285 <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>
286 <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
287 transport available for storage functions.
</p>
290 <dl class=
"enumerator">
291 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SND_TIMEOUTE">
292 <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>
293 <dd><p>This sets the microsecond behavior of the socket against the SO_SNDTIMEO
295 <p>In cases where you cannot use non-blocking IO this will allow you to
296 still have timeouts on the sending of data.
</p>
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
304 <p>In cases where you cannot use non-blocking IO this will allow you to
305 still have timeouts on the reading of data.
</p>
308 <dl class=
"enumerator">
309 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_TCP_NODELAYE">
310 <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>
311 <dd><p>Disables Nagle's algorithm.
312 See
<a class=
"reference external" href=
"https://tools.ietf.org/html/rfc896">RFC
896</a>.
</p>
315 <dl class=
"enumerator">
316 <dt id=
"_CPPv4N20memcached_behavior_t23MEMCACHED_BEHAVIOR_HASHE">
317 <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>
318 <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>
319 <p>Each hash has its advantages and its weaknesses. If you don't know or
320 don't care, just go with the default.
</p>
323 <dl class=
"enumerator">
324 <dt id=
"_CPPv4N20memcached_behavior_t31MEMCACHED_BEHAVIOR_DISTRIBUTIONE">
325 <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>
326 <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
327 means of distributing values to servers.
</p>
328 <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
329 key modulo number of servers).
</p>
330 <p>You can enable consistent hashing by setting
331 <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
332 distribution and allows servers to be added to the cluster with minimal
334 <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
335 <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>
338 <dl class=
"enumerator">
339 <dt id=
"_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_CACHE_LOOKUPSE">
340 <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>
342 <div><div class=
"deprecated">
343 <p><span class=
"versionmodified">Deprecated since version
0.46(?):
</span>DNS lookups are now always cached until an error occurs with the
347 <p>Memcached can cache named lookups so that DNS lookups are made only once.
</p>
350 <dl class=
"enumerator">
351 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_SUPPORT_CASE">
352 <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>
353 <dd><p>Support CAS operations (this is not enabled by default at this point in
354 the server since it imposes a slight performance penalty).
</p>
357 <dl class=
"enumerator">
358 <dt id=
"_CPPv4N20memcached_behavior_t25MEMCACHED_BEHAVIOR_KETAMAE">
359 <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>
360 <dd><p>Sets the default distribution to
361 <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
362 <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>
365 <dl class=
"enumerator">
366 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_KETAMA_WEIGHTEDE">
367 <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>
368 <dd><p>Sets the default distribution to
369 <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.
370 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>
373 <dl class=
"enumerator">
374 <dt id=
"_CPPv4N20memcached_behavior_t30MEMCACHED_BEHAVIOR_KETAMA_HASHE">
375 <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>
376 <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>
379 <dl class=
"enumerator">
380 <dt id=
"_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_KETAMA_COMPATE">
381 <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>
382 <dd><p>Sets the compatibility mode. The value can be set to either
383 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_KETAMA_COMPAT_LIBMEMCACHED
</span></code> (this is the default) or
384 <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
388 <dl class=
"enumerator">
389 <dt id=
"_CPPv4N20memcached_behavior_t31MEMCACHED_BEHAVIOR_POLL_TIMEOUTE">
390 <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>
391 <dd><p>Modify the timeout in milliseconds value that is used by poll. The
392 default value is -
1. An signed int must be passed to
393 <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).
394 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
395 returned as 'unsigned long long'.
</p>
398 <dl class=
"enumerator">
399 <dt id=
"_CPPv4N20memcached_behavior_t28MEMCACHED_BEHAVIOR_USER_DATAE">
400 <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>
401 <dd><div class=
"deprecated">
402 <p><span class=
"versionmodified">Deprecated since version
<:
</span>0.30</p>
406 <dl class=
"enumerator">
407 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BUFFER_REQUESTSE">
408 <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>
409 <dd><p>Enabling buffered IO causes commands to
"buffer
" instead of being sent.
410 Any action that gets data causes this buffer to be be sent to the remote
411 connection. Quiting the connection or closing down the connection will
412 also cause the buffered data to be pushed to the remote connection.
</p>
415 <dl class=
"enumerator">
416 <dt id=
"_CPPv4N20memcached_behavior_t29MEMCACHED_BEHAVIOR_VERIFY_KEYE">
417 <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>
418 <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
419 they are valid keys.
</p>
422 <dl class=
"enumerator">
423 <dt id=
"_CPPv4N20memcached_behavior_t29MEMCACHED_BEHAVIOR_SORT_HOSTSE">
424 <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>
425 <dd><p>Enabling this will cause hosts that are added to be placed in the host
426 list in sorted order. This will defeat consistent hashing.
</p>
429 <dl class=
"enumerator">
430 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_CONNECT_TIMEOUTE">
431 <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>
432 <dd><p>In non-blocking mode this changes the value of the timeout during socket
433 connection in milliseconds. Specifying -
1 means an infinite time‐out.
</p>
436 <dl class=
"enumerator">
437 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_BINARY_PROTOCOLE">
438 <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>
439 <dd><p>Enable the use of the binary protocol. Please note that you cannot
440 toggle this flag on an open connection.
</p>
443 <dl class=
"enumerator">
444 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_IO_MSG_WATERMARKE">
445 <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>
446 <dd><p>Set this value to tune the number of messages that may be sent before
447 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> should start to automatically drain the input queue.
</p>
448 <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
449 to send data, but the send will block because the input buffer in the
453 <dl class=
"enumerator">
454 <dt id=
"_CPPv4N20memcached_behavior_t37MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARKE">
455 <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>
456 <dd><p>Set this value to tune the number of bytes that may be sent before
457 <code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">libmemcached
</span></code> should start to automatically drain the input queue (need
458 at least
10 IO requests sent without reading the input buffer).
</p>
459 <p>Setting this value to high, may cause libmemcached to deadlock (trying
460 to send data, but the send will block because the input buffer in the
464 <dl class=
"enumerator">
465 <dt id=
"_CPPv4N20memcached_behavior_t34MEMCACHED_BEHAVIOR_IO_KEY_PREFETCHE">
466 <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>
467 <dd><p>The binary protocol works a bit different than the textual protocol in
468 that a multiget is implemented as a pipe of single get-operations which
469 are sent to the server in a chunk.
</p>
470 <p>If you are using large multigets from your application, you may improve
471 the latency of the gets by setting this value so you send out the first
472 chunk of requests when you hit the specified limit. It allows the
473 servers to start processing the requests to send the data back while the
474 rest of the requests are created and sent to the server.
</p>
477 <dl class=
"enumerator">
478 <dt id=
"_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_NOREPLYE">
479 <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>
480 <dd><p>Set this value to specify that you really don't care about the result
481 from your storage commands (set, add, replace, append, prepend).
</p>
484 <dl class=
"enumerator">
485 <dt id=
"_CPPv4N20memcached_behavior_t37MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICASE">
486 <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>
487 <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
488 (on different servers).
</p>
489 <p>This replication does not dedicate certain memcached servers to store
490 the replicas in, but instead it will store the replicas together with
491 all of the other objects (on the 'n' next servers specified in your
493 <p>Requires the binary protocol and only supports (M)GET/SET/DELETE.
</p>
494 <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>
497 <dl class=
"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=
"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 failure the read is done from
502 primary +
1, then primary +
2 all the way to 'n' replicas.
</p>
503 <p>This allows distributing read load to multiple servers with the expense
504 of more write traffic.
</p>
505 <p><strong>NOTE
</strong>: Only errors to communicate with a server are considered
506 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>
509 <dl class=
"enumerator">
510 <dt id=
"_CPPv4N20memcached_behavior_t23MEMCACHED_BEHAVIOR_CORKE">
511 <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>
512 <dd><div class=
"deprecated">
513 <p><span class=
"versionmodified">Deprecated since version ?:
</span>This option has been deprecated with the behavior now built in and
514 used appropriately on selected platforms.
</p>
518 <dl class=
"enumerator">
519 <dt id=
"_CPPv4N20memcached_behavior_t28MEMCACHED_BEHAVIOR_KEEPALIVEE">
520 <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>
521 <dd><p>Enable TCP_KEEPALIVE behavior.
</p>
524 <dl class=
"enumerator">
525 <dt id=
"_CPPv4N20memcached_behavior_t33MEMCACHED_BEHAVIOR_KEEPALIVE_IDLEE">
526 <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>
527 <dd><p>Specify time, in seconds, to mark a connection as idle. This is only
528 available as an option on Linux.
</p>
531 <dl class=
"enumerator">
532 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZEE">
533 <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>
534 <dd><p>Find the current size of SO_SNDBUF. A value of
0 means either an error
535 occurred or no hosts were available. It is safe to assume system default
537 <p>If an error occurs you can check the last cached errno to find the
541 <dl class=
"enumerator">
542 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZEE">
543 <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>
544 <dd><p>Find the current size of SO_RCVBUF. A value of
0 means either an error
545 occurred or no hosts were available. It is safe to assume system default
547 <p>If an error occurs you can check the last cached errno to find the
551 <dl class=
"enumerator">
552 <dt id=
"_CPPv4N20memcached_behavior_t39MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMITE">
553 <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>
554 <dd><div class=
"deprecated">
555 <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>
557 <p>Set this value to enable the server be removed after continuous
558 <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>
561 <dl class=
"enumerator">
562 <dt id=
"_CPPv4N20memcached_behavior_t35MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTSE">
563 <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>
564 <dd><div class=
"deprecated">
565 <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>
567 <p>If enabled any hosts which have been flagged as disabled will be removed
568 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
569 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>
572 <dl class=
"enumerator">
573 <dt id=
"_CPPv4N20memcached_behavior_t40MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERSE">
574 <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>
575 <dd><p>If enabled any hosts which have been flagged as disabled will be removed
576 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>
579 <dl class=
"enumerator">
580 <dt id=
"_CPPv4N20memcached_behavior_t32MEMCACHED_BEHAVIOR_RETRY_TIMEOUTE">
581 <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>
582 <dd><p>When enabled a host which is problematic will only be checked for usage
583 based on the amount of time set by this behavior. The value is in
587 <dl class=
"enumerator">
588 <dt id=
"_CPPv4N20memcached_behavior_t39MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEYE">
589 <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>
590 <dd><p>When enabled the prefix key will be added to the key when determining
591 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
598 <dt id=
"c.memcached_server_distribution_t">
599 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>
603 <dt id=
"_CPPv431memcached_server_distribution_t">
604 <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>
605 <dd><dl class=
"enumerator">
606 <dt id=
"_CPPv4N31memcached_server_distribution_t29MEMCACHED_DISTRIBUTION_MODULAE">
607 <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>
608 <dd><p>Distribute keys by hash modulo number of servers.
</p>
611 <dl class=
"enumerator">
612 <dt id=
"_CPPv4N31memcached_server_distribution_t33MEMCACHED_DISTRIBUTION_CONSISTENTE">
613 <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>
614 <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>
617 <dl class=
"enumerator">
618 <dt id=
"_CPPv4N31memcached_server_distribution_t40MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMAE">
619 <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>
620 <dd><p>Unweighted consistent key distribution.
</p>
623 <dl class=
"enumerator">
624 <dt id=
"_CPPv4N31memcached_server_distribution_t29MEMCACHED_DISTRIBUTION_RANDOME">
625 <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>
626 <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>
629 <dl class=
"enumerator">
630 <dt id=
"_CPPv4N31memcached_server_distribution_t44MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPYE">
631 <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>
632 <dd><p>Unweighted consistent key distribution compatible with the SPY client.
</p>
635 <dl class=
"enumerator">
636 <dt id=
"_CPPv4N31memcached_server_distribution_t42MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTEDE">
637 <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>
638 <dd><p>Weighted consistent key distribution.
</p>
641 <dl class=
"enumerator">
642 <dt id=
"_CPPv4N31memcached_server_distribution_t37MEMCACHED_DISTRIBUTION_VIRTUAL_BUCKETE">
643 <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>
644 <dd><p>Consistent key distribution by virtual buckets.
</p>
650 <div class=
"section" id=
"description">
651 <h2>DESCRIPTION
<a class=
"headerlink" href=
"#description" title=
"Permalink to this headline">¶
</a></h2>
652 <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>.
653 Default behavior is the library strives to be quick and accurate. Some behavior,
654 while being faster, can also result in not entirely accurate behavior (for
655 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>
656 <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
657 that behavior is currently enabled in the client.
</p>
658 <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.
659 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
660 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
661 reset all connections.
</p>
663 <div class=
"section" id=
"return-value">
664 <h2>RETURN VALUE
<a class=
"headerlink" href=
"#return-value" title=
"Permalink to this headline">¶
</a></h2>
665 <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
666 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>
667 returns failure or success.
</p>
669 <div class=
"section" id=
"notes">
670 <h2>NOTES
<a class=
"headerlink" href=
"#notes" title=
"Permalink to this headline">¶
</a></h2>
671 <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
672 0.17 from taking a pointer to data value, to taking a uin64_t.
</p>
674 <div class=
"section" id=
"see-also">
675 <h2>SEE ALSO
<a class=
"headerlink" href=
"#see-also" title=
"Permalink to this headline">¶
</a></h2>
677 <li><em class=
"manpage"><a class=
"manpage reference external" href=
"https://linux.die.net/man/1/memcached">memcached(
1)
</a></em></li>
678 <li><em class=
"manpage"><a class=
"manpage reference external" href=
"https://linux.die.net/man/3/setsockopt">setsockopt(
3)
</a></em></li>
679 <li><a class=
"reference internal" href=
"../libmemcached.html"><span class=
"doc">C/C++ Client Library for memcached
</span></a></li>
680 <li><a class=
"reference internal" href=
"memcached_strerror.html"><span class=
"doc">Converting Error Codes to Messages
</span></a></li>
691 <div class=
"rst-footer-buttons" role=
"navigation" aria-label=
"footer navigation">
693 <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>
696 <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>
703 <div role=
"contentinfo">
705 © <a href=
"../copyright.html">Copyright
</a>
709 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>.
722 <script type=
"text/javascript">
724 SphinxRtdTheme.Navigation.enable(true);