+ memcached_st *memc= memcached_create(NULL);
+
+ if (opt_udp)
+ {
+ if (opt_verbose)
+ {
+ std::cout << "Enabling UDP" << std::endl;
+ }
+
+ if (memcached_failed(memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_USE_UDP, opt_udp)))
+ {
+ memcached_free(memc);
+ std::cerr << "Could not enable UDP protocol." << std::endl;
+ return EXIT_FAILURE;
+ }
+ }
+
+ if (opt_buffer)
+ {
+ if (opt_verbose)
+ {
+ std::cout << "Enabling MEMCACHED_BEHAVIOR_BUFFER_REQUESTS" << std::endl;
+ }
+
+ if (memcached_failed(memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, opt_buffer)))
+ {
+ memcached_free(memc);
+ std::cerr << "Could not enable MEMCACHED_BEHAVIOR_BUFFER_REQUESTS." << std::endl;
+ return EXIT_FAILURE;
+ }
+ }
+