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

Function main

lib_acl_cpp/samples/aio/ssl_aio_client/main.cpp:208–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208int main(int argc, char* argv[])
209{
210 bool use_kernel = false;
211 int ch;
212 IO_CTX ctx;
213
214 memset(&ctx, 0, sizeof(ctx));
215 ctx.connect_timeout = 500;
216 ctx.nopen_limit = 10;
217 ctx.id_begin = 1;
218 ctx.nwrite_limit = 10;
219 ctx.debug = false;
220 //snprintf(ctx.addr, sizeof(ctx.addr), "74.125.71.19:443");
221 //snprintf(ctx.addr, sizeof(ctx.addr), "www.google.com.hk:443");
222 snprintf(ctx.addr, sizeof(ctx.addr), "mail.sina.com.cn:443");
223
224 while ((ch = getopt(argc, argv, "hc:n:kl:dt:")) > 0)
225 {
226 switch (ch)
227 {
228 case 'c':
229 ctx.nopen_limit = atoi(optarg);
230 if (ctx.nopen_limit <= 0)
231 ctx.nopen_limit = 10;
232 break;
233 case 'n':
234 ctx.nwrite_limit = atoi(optarg);
235 if (ctx.nwrite_limit <= 0)
236 ctx.nwrite_limit = 10;
237 break;
238 case 'h':
239 usage(argv[0]);
240 return (0);
241 case 'k':
242 use_kernel = true;
243 break;
244 case 'l':
245 snprintf(ctx.addr, sizeof(ctx.addr), "%s", optarg);
246 break;
247 case 'd':
248 ctx.debug = true;
249 break;
250 case 't':
251 ctx.connect_timeout = atoi(optarg);
252 break;
253 default:
254 break;
255 }
256 }
257
258 ACL_METER_TIME("-----BEGIN-----");
259 acl::acl_cpp_init();
260
261 aio_handle handle(use_kernel ? ENGINE_KERNEL : ENGINE_SELECT);
262 ctx.handle = &handle;
263
264 if (connect_ssl_server(&ctx, ctx.id_begin) == false)
265 {

Callers

nothing calls this directly

Calls 6

acl_cpp_initFunction · 0.85
connect_ssl_serverFunction · 0.85
usageFunction · 0.70
getoptFunction · 0.50
checkMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…