Re-work of thread model

This commit is contained in:
Joseph Henry
2019-02-06 22:00:39 -08:00
parent 292fcdda2c
commit 2fdcf025e1
138 changed files with 7567 additions and 15053 deletions

View File

@@ -26,7 +26,9 @@ Java JNI API: [ZeroTier.java](packages/android/app/src/main/java/ZeroTier.java)
### C++ Example
```
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include "libzt.h"
@@ -36,15 +38,14 @@ int main()
char *remoteIp = "10.8.8.42";
int remotePort = 8080;
int fd, err = 0;
struct zts_sockaddr_in addr;
addr.sin_family = ZTS_AF_INET;
struct sockaddr_in addr;
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = inet_addr(remoteIp);
addr.sin_port = htons(remotePort);
zts_startjoin("path", 0xc7cd7c981b0f52a2); // config path, network ID
printf("nodeId=%llx\n", zts_get_node_id());
if ((fd = zts_socket(ZTS_AF_INET, ZTS_SOCK_STREAM, 0)) < 0) {
if ((fd = zts_socket(AF_INET, SOCK_STREAM, 0)) < 0) {
printf("error creating socket\n");
}
if ((err = zts_connect(fd, (const struct sockaddr *)&addr, sizeof(addr))) < 0) {