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();
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;