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

Function main

lib_acl_cpp/samples/benchmark/client2/main.cpp:67–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67int main(int argc, char* argv[])
68{
69 acl::acl_cpp_init();
70
71 acl::string addr("127.0.0.1:8888");
72 int ch;
73
74 while ((ch = getopt(argc, argv, "hs:n:l:")) > 0 )
75 {
76 switch (ch)
77 {
78 case 'h':
79 usage(argv[0]);
80 return 0;
81 case 's':
82 addr = optarg;
83 break;
84 case 'n':
85 __max = atoi(optarg);
86 if (__max < 1)
87 __max = 1;
88 break;
89 case 'l':
90 __len = atoi(optarg);
91 if (__len <= 0)
92 __len = 10;
93 break;
94 default:
95 usage(argv[0]);
96 return 0;
97 }
98 }
99
100 acl::socket_stream conn;
101 if (conn.open(addr, 30, 30) == false)
102 {
103 printf("connect %s error\r\n", addr.c_str());
104 return -1;
105 }
106
107 handle_connection(conn);
108 return 0;
109}

Callers

nothing calls this directly

Calls 6

acl_cpp_initFunction · 0.85
usageFunction · 0.70
handle_connectionFunction · 0.70
getoptFunction · 0.50
openMethod · 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…