| 131 | } |
| 132 | |
| 133 | int 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…