MCPcopy Create free account
hub / github.com/acl-dev/acl / load_servers

Function load_servers

lib_acl_cpp/samples/connect/main.cpp:70–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70static void load_servers(std::vector<acl::string>& servers, const char* f)
71{
72 acl::ifstream fp;
73 if (!fp.open_read(f)) {
74 printf("Open %s error %s\r\n", f, acl::last_serror());
75 return;
76 }
77
78 acl::string buf;
79 while (!fp.eof()) {
80 if (!fp.gets(buf)) {
81 break;
82 }
83 if (acl_valid_ipv6_hostaddr(buf.c_str(), 0)) {
84 printf("Valid IPv6 addr=%s\r\n", buf.c_str());
85 } else {
86 printf("Invalid IPv6 addr=%s\r\n", buf.c_str());
87 }
88 servers.push_back(buf);
89 }
90
91 printf("Enter any key to continue...");
92 fflush(stdout);
93 getchar();
94}
95
96static void usage(const char* procname)
97{

Callers 1

mainFunction · 0.85

Calls 7

acl_valid_ipv6_hostaddrFunction · 0.85
getsMethod · 0.80
last_serrorFunction · 0.50
open_readMethod · 0.45
eofMethod · 0.45
c_strMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…