X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fserver.h;h=bbebe95714c2b000a9d2ee353175a8c9606cb57e;hb=62d142cd69b5b6b7e044319085bc011e85dd90eb;hp=c4e7579cf8975b33838b64641f3abb1bb56fa7d9;hpb=6b04196d0ea6aa9fcd2a6c14a6cb5733c34aa2d2;p=awesomized%2Flibmemcached diff --git a/libtest/server.h b/libtest/server.h index c4e7579c..bbebe957 100644 --- a/libtest/server.h +++ b/libtest/server.h @@ -41,15 +41,8 @@ #include #include #include - -#ifdef HAVE_NETDB_H -# include -#endif - -#ifdef HAVE_NETINET_IN_H -# include -#endif - +#include +#include #include #include #include @@ -184,7 +177,8 @@ public: virtual bool ping()= 0; - virtual bool build(size_t argc, const char *argv[])= 0; + bool init(const char *argv[]); + virtual bool build()= 0; void add_option(const std::string&); void add_option(const std::string&, const std::string&); @@ -230,6 +224,11 @@ public: _error= arg; } + void reset_error() + { + _error.clear(); + } + virtual bool wait_for_pidfile() const; bool check_pid(pid_t pid_arg) const @@ -239,7 +238,7 @@ public: bool is_socket() const { - return _hostname[0] == '/'; + return _is_socket; } const std::string running() const @@ -267,6 +266,11 @@ public: return out_of_ban_killed_; } + void timeout(uint32_t timeout_) + { + _timeout= timeout_; + } + protected: bool set_pid_file(); Options _options; @@ -283,6 +287,7 @@ private: bool args(Application&); std::string _error; + uint32_t _timeout; // This number should be high enough for valgrind startup (which is slow) }; std::ostream& operator<<(std::ostream& output, const libtest::Server &arg);