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

Function main

lib_rpc/samples/http_rpc_client/http_rpc_client.cpp:133–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133int main(int argc, char* argv[])
134{
135
136 char addr[64];
137 int ch, max = 1;
138 bool use_mempool = false;
139
140 snprintf(addr, sizeof(addr), "127.0.0.1:8888");
141
142 while ((ch = getopt(argc, argv, "hs:n:m")) > 0)
143 {
144 switch (ch)
145 {
146 case 'h':
147 usage(argv[0]);
148 return 0;
149 case 's':
150 snprintf(addr, sizeof(addr), "%s", optarg);
151 break;
152 case 'n':
153 max = atoi(optarg);
154 if (max <= 0)
155 max = 1;
156 break;
157 case 'm':
158 use_mempool = true;
159 break;
160 default:
161 break;
162 }
163 }
164
165#ifdef WIN32
166 acl::acl_cpp_init();
167#endif
168
169 if (use_mempool)
170 acl_mem_slice_init(8, 1024, 100000,
171 ACL_SLICE_FLAG_GC2 |
172 ACL_SLICE_FLAG_RTGC_OFF |
173 ACL_SLICE_FLAG_LP64_ALIGN);
174
175 handle_rpc(addr, max);
176
177 // Optional: Delete all global objects allocated by libprotobuf.
178 google::protobuf::ShutdownProtobufLibrary();
179
180#ifdef WIN32
181 printf("Enter any key to exit\r\n");
182 getchar();
183#endif
184 return 0;
185}

Callers

nothing calls this directly

Calls 5

acl_cpp_initFunction · 0.85
acl_mem_slice_initFunction · 0.85
handle_rpcFunction · 0.85
usageFunction · 0.70
getoptFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…