+ const char *socket_file_option() const
+ {
+ return "-s ";
+ }
+
+ virtual void port_option(Application& app, in_port_t arg)
+ {
+ char buffer[30];
+ snprintf(buffer, sizeof(buffer), "%d", int(arg));
+ app.add_option("-p", buffer);
+ }
+
+ bool has_port_option() const
+ {
+ return true;
+ }
+
+ bool has_socket_file_option() const
+ {
+ return has_socket();
+ }
+
+ void socket_file_option(Application& app, const std::string& socket_arg)
+ {
+ if (socket_arg.empty() == false)
+ {
+ app.add_option("-s", socket_arg);
+ }
+ }
+
+ bool broken_socket_cleanup()
+ {
+ return true;
+ }
+
+ // Memcached's pidfile is broken
+ bool broken_pid_file()
+ {
+ return true;
+ }
+
+ bool build(size_t argc, const char *argv[]);
+};
+
+class MemcachedLight : public libtest::Server
+{
+
+public:
+ MemcachedLight(const std::string& host_arg, const in_port_t port_arg) :
+ libtest::Server(host_arg, port_arg, MEMCACHED_LIGHT_BINARY, true)
+ {
+ set_pid_file();
+ }
+
+ bool ping()
+ {
+ // Memcached is slow to start, so we need to do this
+ if (not pid_file().empty())
+ {
+ if (not wait_for_pidfile())