3 #include <sys/socket.h>
4 #include <netinet/tcp.h>
6 memcached_return
memcached_behavior_set(memcached_st
*ptr
,
7 memcached_behavior flag
,
12 case MEMCACHED_BEHAVIOR_NO_BLOCK
:
13 /* We quit all connections so we can reset the sockets */
15 ptr
->flags
|= MEM_NO_BLOCK
;
17 case MEMCACHED_BEHAVIOR_BLOCK
:
18 /* We quit all connections so we can reset the sockets */
20 ptr
->flags
+= MEM_NO_BLOCK
;
22 case MEMCACHED_BEHAVIOR_TCP_NODELAY
:
23 /* We quit all connections so we can reset the sockets */
25 ptr
->flags
|= MEM_TCP_NODELAY
;
27 case MEMCACHED_BEHAVIOR_TCP_DELAY
:
28 /* We quit all connections so we can reset the sockets */
30 ptr
->flags
+= MEM_TCP_NODELAY
;
34 return MEMCACHED_SUCCESS
;