MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / init

Function init

tools/pmux/pmux.cpp:730–749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

728}
729
730static bool init(const std::vector<std::pair<int, int>> &pranges)
731{
732
733 if (!init_local_names()) {
734 syslog(LOG_CRIT, "failed to get host names\n");
735 return false;
736 }
737 for (auto &range : pranges) {
738 debug_log("%s free port range %d - %d\n", __func__, range.first,
739 range.second);
740 for (int s = range.first; s <= range.second; ++s) {
741 free_ports.insert(s);
742 }
743 }
744 port_map = pmux_store->get_ports();
745 for (auto &p : port_map) {
746 free_ports.erase(p.second);
747 }
748 return true;
749}
750
751int main(int argc, char **argv)
752{

Callers 2

connectionMethod · 0.70
mainFunction · 0.70

Calls 2

init_local_namesFunction · 0.85
get_portsMethod · 0.45

Tested by

no test coverage detected