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

Function main

lib_acl_cpp/samples/connect/main.cpp:101–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101int main(int argc, char* argv[])
102{
103 std::vector<acl::string> addrs;
104 int ch, n = 0;
105
106 while ((ch = getopt(argc, argv, "hs:f:n:")) > 0) {
107 switch (ch) {
108 case 'h':
109 usage(argv[0]);
110 return 0;
111 case 's':
112 add_servers(addrs, optarg);
113 break;
114 case 'f':
115 load_servers(addrs, optarg);
116 break;
117 case 'n':
118 n = atoi(optarg);
119 break;
120 default:
121 break;
122 }
123 }
124
125 if (addrs.empty()) {
126 usage(argv[0]);
127 return 0;
128 }
129
130 std::vector<acl::thread*> threads;
131
132 for (std::vector<acl::string>::const_iterator cit = addrs.begin();
133 cit != addrs.end(); ++cit) {
134
135 acl::thread* thr = new client(*cit, n);
136 threads.push_back(thr);
137 thr->start();
138 }
139
140 for (std::vector<acl::thread*>::iterator it = threads.begin();
141 it != threads.end(); ++it) {
142
143 (*it)->wait();
144 delete *it;
145 }
146 return 0;
147}

Callers

nothing calls this directly

Calls 10

add_serversFunction · 0.85
load_serversFunction · 0.85
beginMethod · 0.80
usageFunction · 0.70
getoptFunction · 0.50
emptyMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
startMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…