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

Function main

lib_acl/samples/udp/client/main.cpp:190–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190int main(int argc, char *argv[])
191{
192 char peer[64], local[64];
193 int ch, count = 1, dlen = 100, inter = 1000, nthreads = 1, quit = 0;
194 int need_read = 0, mio_on = 0;
195
196 acl_lib_init();
197 acl_msg_stdout_enable(1);
198
199 snprintf(peer, sizeof(peer), "127.0.0.1:8888");
200 snprintf(local, sizeof(local), "127.0.0.1:0");
201
202 while ((ch = getopt(argc, argv, "hl:s:n:N:i:t:rqm")) > 0) {
203 switch (ch) {
204 case 'h':
205 usage(argv[0]);
206 return 0;
207 case 'l':
208 snprintf(local, sizeof(local), "%s", optarg);
209 break;
210 case 's':
211 snprintf(peer, sizeof(peer), "%s", optarg);
212 break;
213 case 'n':
214 count = atoi(optarg);
215 break;
216 case 'N':
217 dlen = atoi(optarg);
218 break;
219 case 'i':
220 inter = atoi(optarg);
221 break;
222 case 't':
223 nthreads = atoi(optarg);
224 break;
225 case 'r':
226 need_read = 1;
227 break;
228 case 'q':
229 quit = 1;
230 break;
231 case 'm':
232 mio_on = 1;
233 break;
234 default:
235 break;
236 }
237 }
238
239 if (peer[0] == 0 || local[0] == 0) {
240 usage(argv[0]);
241 return 1;
242 }
243
244 if (nthreads > 1) {
245 int i;
246 acl_pthread_pool_t *threads =
247 acl_thread_pool_create(nthreads, 120);

Callers

nothing calls this directly

Calls 8

acl_lib_initFunction · 0.85
acl_msg_stdout_enableFunction · 0.85
acl_thread_pool_createFunction · 0.85
acl_pthread_pool_destroyFunction · 0.85
acl_lib_endFunction · 0.85
usageFunction · 0.70
runFunction · 0.70
getoptFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…