4 This closes all connections (forces flush of input as well).
6 Maybe add a host specific, or key specific version?
8 The reason we send "quit" is that in case we have buffered IO, this
9 will force data to be completed.
12 void memcached_quit_server(memcached_st
*ptr
, unsigned int server_key
)
14 if (ptr
->hosts
[server_key
].fd
!= -1)
16 if (ptr
->flags
& MEM_NO_BLOCK
)
17 memcached_io_write(ptr
, server_key
, "quit\r\n", 6, 1);
18 close(ptr
->hosts
[server_key
].fd
);
19 ptr
->hosts
[server_key
].fd
= -1;
20 ptr
->hosts
[server_key
].stack_responses
= 0;
21 ptr
->hosts
[server_key
].cursor_active
= 0;
27 void memcached_quit(memcached_st
*ptr
)
33 for (x
= 0; x
< ptr
->number_of_hosts
; x
++)
34 memcached_quit_server(ptr
, x
);