Able to accept connection

This commit is contained in:
juju committed 2020-05-05 15:59:10 +02:00
1 parent f512de7313
commit b6c825a877
1 file changed
+15
+15
View File
@@ -6,12 +6,27 @@
paxos::EventWatcherRegistry paxos::event_register; paxos::EventWatcherRegistry paxos::event_register;
ev_signal sigint_watcher;
static void sigint_cb(struct ev_loop* loop, ev_signal*, int)
{
ev_break(loop, EVBREAK_ALL);
}
int main(int, char **argv) int main(int, char **argv)
{ {
paxos::ServerConfig server_config = paxos::ServerConfig::parse(argv[1]); paxos::ServerConfig server_config = paxos::ServerConfig::parse(argv[1]);
ev_signal_init(&sigint_watcher, sigint_cb, SIGINT);
paxos::event_register.get_event_loop().register_sigint_watcher(&sigint_watcher);
paxos::LegislatorFactory::Create(server_config.self_);
for (auto config : server_config.legislators_) for (auto config : server_config.legislators_)
{ {
paxos::LegislatorFactory::Create(config); paxos::LegislatorFactory::Create(config);
} }
paxos::event_register.get_event_loop()();
return 0;
} }
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.