Started to abstract out the stats calls.
[m6w6/libmemcached] / lib / memcached_quit.c
1 #include <memcached.h>
2
3 /*
4 This closes all connections (forces flush of input as well).
5
6 Maybe add a host specific, or key specific version?
7 */
8 void memcached_quit(memcached_st *ptr)
9 {
10 unsigned int x;
11
12 if (ptr->hosts)
13 {
14 for (x= 0; x < ptr->number_of_hosts; x++)
15 {
16 if (ptr->hosts[x].fd > 0)
17 close(ptr->hosts[x].fd);
18 }
19 }
20 ptr->connected= 0;
21 }