Add zts_core_query_ and world sub-APIs. Adjust event subsystem

This commit is contained in:
Joseph Henry
2021-04-26 21:55:01 -07:00
parent ac7e01f328
commit c456a87f97
22 changed files with 1130 additions and 803 deletions

View File

@@ -18,7 +18,7 @@ int main(int argc, char** argv)
exit(0);
}
char* storage_path = argv[1];
uint64_t net_id = strtoull(argv[2], NULL, 16);
long long int net_id = strtoull(argv[2], NULL, 16); // At least 64 bits
char* local_addr = argv[3];
int local_port = atoi(argv[4]);
int fd, accfd;
@@ -52,7 +52,7 @@ int main(int argc, char** argv)
}
printf("Don't forget to authorize this device in my.zerotier.com or the web API!\n");
printf("Waiting for join to complete\n");
while (zts_net_count() < 1) {
while (! zts_net_transport_is_ready(net_id)) {
zts_util_delay(50);
}
@@ -77,8 +77,7 @@ int main(int argc, char** argv)
char remote_addr[ZTS_INET6_ADDRSTRLEN] = { 0 };
int remote_port = 0;
int len = ZTS_INET6_ADDRSTRLEN;
if ((accfd = zts_simple_tcp_server(local_addr, local_port, remote_addr, len, &remote_port))
< 0) {
if ((accfd = zts_simple_tcp_server(local_addr, local_port, remote_addr, len, &remote_port)) < 0) {
printf("Error (fd=%d, zts_errno=%d). Exiting.\n", accfd, zts_errno);
exit(1);
}