#include <iostream>
try {
std::vector<std::pair<port_t, bool>> ports{{80, true}, {443, false}};
} catch (std::bad_alloc &e) {
std::cerr << "Memory allocation failed: " << e.what() << '\n';
return 1;
} catch (std::system_error &e) {
std::cerr << "System error: " << e.what() << '\n';
return 2;
} catch (...) {
std::cerr << "Unexpected error occurred.\n";
return -1;
}
}
static void print(std::vector< std::pair< port_t, bool > > const &ports)
Prints to stdout the formated information about the ports accessibility.
static bool isTerminal() noexcept
Checks if stdout is connected to a terminal.
int main(int argc, char *argv[])