46 #include <sys/types.h>
62 : m_app_queue(app_queue), m_master(master) { }
65 dhp = make_shared<ServerConnectionHandler>(m_app_queue, m_master);
74 int main(
int argc,
char **argv) {
78 init_with_policy<AppPolicy>(argc, argv);
85 make_shared<Master>(conn_mgr,
properties, keepalive_handler, app_queue);
86 function<void()> sleep_callback = [master]() ->
void {master->handle_sleep();};
87 function<void()> wakeup_callback = [master]() ->
void {master->handle_wakeup();};
89 uint16_t port =
has(
"port") ? get_i16(
"port") : get_i16(
"Hyperspace.Replica.Port");
92 comm->listen(local_addr, hf);
95 comm->create_datagram_receive_socket(local_addr, 0x10, keepalive_handler);
98 uint32_t maintenance_interval = get_i32(
"Hyperspace.Maintenance.Interval");
102 hf->get_instance(maintenance_dhp);
103 if ((error = comm->set_timer(maintenance_interval, maintenance_dhp)) !=
Error::OK)
static Comm * instance()
Creates/returns singleton instance of the Comm class.
Declarations for ConnectionHandlerFactory.
Retrieves system information (hardware, installation directory, etc)
virtual void get_instance(DispatchHandlerPtr &dhp)
Creates a connection dispatch handler.
Delivers sleep and wakeup notifications.
PropertiesPtr properties
This singleton map stores all options.
Helper class for printing usage banners on the command line.
Abstract class for creating default application dispatch handlers.
std::shared_ptr< Master > MasterPtr
int main(int argc, char **argv)
HandlerFactory(ApplicationQueuePtr &app_queue, MasterPtr &master)
bool has(const String &name)
Check existence of a configuration value.
std::shared_ptr< ConnectionHandlerFactory > ConnectionHandlerFactoryPtr
Smart pointer to ConnectionHandlerFactory.
const char * get_text(int error)
Returns a descriptive error message.
Encapsulate an internet address.
Helpers to compose init policies; allow to combine two policies into one.
Compatibility Macros for C/C++.
std::shared_ptr< ServerKeepaliveHandler > ServerKeepaliveHandlerPtr
Initialization helper for applications.
#define HT_FATALF(msg,...)
Entry point to AsyncComm service.
Declaration for SleepWakeNotifier.
Internet address wrapper classes and utility functions.
This is a generic exception class for Hypertable.
std::shared_ptr< DispatchHandler > DispatchHandlerPtr
Smart pointer to DispatchHandler.
Declarations for ApplicationQueue.
std::shared_ptr< ConnectionManager > ConnectionManagerPtr
Smart pointer to ConnectionManager.
std::shared_ptr< ApplicationQueue > ApplicationQueuePtr
Shared smart pointer to ApplicationQueue object.
Error codes, Exception handling, error logging.
Address abstraction to hold either proxy name or IPv4:port address.
ApplicationQueuePtr m_app_queue