X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fclient.hpp;h=979a532adffdef0f63d91582f581f707c891d5a7;hb=17690735658d7b44f91579df91e31da9ae185158;hp=25d0992fa537be4178cc429dd9b91a285b6b475a;hpb=ca4c07089731f34e76f6514fd88ff2a09280e2dc;p=awesomized%2Flibmemcached diff --git a/libtest/client.hpp b/libtest/client.hpp index 25d0992f..979a532a 100644 --- a/libtest/client.hpp +++ b/libtest/client.hpp @@ -43,9 +43,11 @@ public: SimpleClient(const std::string& hostname_, in_port_t port_); ~SimpleClient(); - bool send_message(const std::string& arg); - bool send_message(const std::string& message_, std::string& response_); + bool send_data(const libtest::vchar_t&, libtest::vchar_t&); + bool send_message(const std::string&); + bool send_message(const std::string&, std::string&); bool response(std::string&); + bool response(libtest::vchar_t&); bool is_valid(); @@ -56,17 +58,18 @@ public: bool is_error() const { - return _error.size(); + return _error.size() ? true : false; } private: // Methods void close_socket(); bool instance_connect(); struct addrinfo* lookup(); - bool message(const std::string&); + bool message(const char* ptr, const size_t len); bool ready(int event_); private: + bool _is_connected; std::string _hostname; in_port_t _port; int sock_fd;