43 : m_comm(comm), m_master(master),
44 m_app_queue_ptr(app_queue), m_shutdown(false) {
67 lock_guard<mutex> lock(
m_mutex);
73 const uint8_t *decode_ptr =
event->payload;
74 size_t decode_remain =
event->payload_len;
81 (
Llu)event->header.command);
83 switch (event->header.command) {
84 case Protocol::COMMAND_KEEPALIVE: {
85 uint64_t session_id =
decode_i64(&decode_ptr, &decode_remain);
86 uint32_t delivered_event_count;
87 std::set<uint64_t> delivered_events;
88 delivered_event_count =
decode_i32(&decode_ptr, &decode_remain);
89 for (uint32_t i=0; i<delivered_event_count; i++)
90 delivered_events.insert(
decode_i64(&decode_ptr, &decode_remain) );
94 m_master, session_id, delivered_events, shutdown, event,
100 (
Llu)event->header.command);
126 HT_INFOF(
"%s", event->to_str().c_str());
136 lock_guard<mutex> lock(
m_mutex);
144 HT_ERRORF(
"Unable to find data for session %llu", (
Llu)session_id);
153 CommBufPtr cbp(Protocol::create_server_keepalive_request(session_ptr));
162 lock_guard<mutex> lock(
m_mutex);
Retrieves system information (hardware, installation directory, etc)
ServerKeepaliveHandler(Comm *comm, Master *master, ApplicationQueuePtr &app_queue_ptr)
void deliver_event_notifications(uint64_t session_id)
Declarations for Protocol.
long long unsigned int Llu
Shortcut for printf formats.
bool get_session(uint64_t session_id, SessionDataPtr &session_data)
std::shared_ptr< SessionData > SessionDataPtr
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
struct sockaddr_in m_send_addr
int send_datagram(const CommAddress &addr, const CommAddress &send_addr, CommBufPtr &cbuf)
Sends a datagram to a remote address.
uint32_t decode_i32(const uint8_t **bufp, size_t *remainp)
Decode a 32-bit integer in little-endian order.
void get_datagram_send_address(struct sockaddr_in *addr)
uint64_t decode_i64(const uint8_t **bufp, size_t *remainp)
Decode a 64-bit integer in little-endian order.
bool decode_bool(const uint8_t **bufp, size_t *remainp)
Decodes a boolean value from the given buffer.
const char * get_text(int error)
Returns a descriptive error message.
std::shared_ptr< CommBuf > CommBufPtr
Smart pointer to CommBuf.
Compatibility Macros for C/C++.
Entry point to AsyncComm service.
#define HT_INFOF(msg,...)
#define HT_THROWF(_code_, _fmt_,...)
Internet address wrapper classes and utility functions.
Request/response message event.
This is a generic exception class for Hypertable.
#define HT_ERRORF(msg,...)
int set_timer(uint32_t duration_millis, const DispatchHandlerPtr &handler)
Sets a timer for duration_millis milliseconds in the future.
ApplicationQueuePtr m_app_queue_ptr
std::shared_ptr< ApplicationQueue > ApplicationQueuePtr
Shared smart pointer to ApplicationQueue object.
String extensions and helpers: sets, maps, append operators etc.
Error codes, Exception handling, error logging.
virtual void handle(Hypertable::EventPtr &event_ptr)
Callback method.