38 : m_comm(comm), m_session(session), m_session_id(0), m_state(DISCONNECTED),
39 m_timeout_ms(timeout_ms), m_verbose(false), m_callbacks_enabled(true) {
53 lock_guard<recursive_mutex> lock(
m_mutex);
56 HT_DEBUGF(
"%s", event_ptr->to_str().c_str());
61 HT_FATALF(
"Connection handshake error: %s",
72 HT_WARNF(
"%s", event_ptr->to_str().c_str());
85 memcpy(&
m_master_addr, &event_ptr->addr,
sizeof(
struct sockaddr_in));
92 HT_FATALF(
"Problem sending handshake request - %s",
97 HT_FATALF(
"Unrecognized event - %s", event_ptr->to_str().c_str());
102 unique_lock<recursive_mutex> lock(
m_mutex);
Retrieves system information (hardware, installation directory, etc)
struct sockaddr_in m_master_addr
#define HT_WARNF(msg,...)
static int32_t response_code(const Event *event)
Returns the response code from an event event generated in response to a request message.
static String string_format_message(const Event *event)
Returns error message decoded standard error MESSAGE generated in response to a request message...
Declarations for Protocol.
std::recursive_mutex m_mutex
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
std::condition_variable_any m_cond
Connection established event.
const char * get_text(int error)
Returns a descriptive error message.
static String exe_name
The exe file name.
void close_socket(const CommAddress &addr)
Closes the socket specified by the addr argument.
std::shared_ptr< CommBuf > CommBufPtr
Smart pointer to CommBuf.
Compatibility Macros for C/C++.
Connection disconnected event.
#define HT_FATALF(msg,...)
#define HT_DEBUGF(msg,...)
Entry point to AsyncComm service.
int state_transition(int state)
Transions state (internal method)
virtual ~ClientConnectionHandler()
Internet address wrapper classes and utility functions.
Request/response message event.
ClientConnectionHandler(Comm *comm, Session *session, uint32_t timeout_ms)
Error codes, Exception handling, error logging.
int send_request(const CommAddress &addr, uint32_t timeout_ms, CommBufPtr &cbuf, DispatchHandler *response_handler)
Sends a request message over a connection, expecting a response.
virtual void handle(Hypertable::EventPtr &event_ptr)
Callback method.