4 #if defined(_WIN32) || defined(__USE_W32_SOCKETS)
7 #pragma comment(lib, "Ws2_32.lib")
10 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
11 #include <netinet/in.h>
13 #include <arpa/inet.h>
16 #if defined(_WIN32) || defined(__USE_W32_SOCKETS)
34 #if defined(_WIN32) || defined(__USE_W32_SOCKETS)
35 #if(_WIN32_WINNT <= 0x0501)
36 binary = inet_addr(address.c_str());
38 inet_pton(AF_INET, address.c_str(), &binary);
41 inet_pton(AF_INET, address.c_str(), &binary);
48 char address[INET_ADDRSTRLEN] = {0};
50 #if defined(_WIN32) || defined(__USE_W32_SOCKETS)
51 InetNtopA(AF_INET, &binary, address,
sizeof(address));
53 inet_ntop(AF_INET, &binary, address,
sizeof(address));
61 #if defined(_WIN32) || defined(__USE_W32_SOCKETS)
62 char tmpPathBuffer[MAX_PATH];
63 GetTempPathA(MAX_PATH, tmpPathBuffer);
64 tmpPath = tmpPathBuffer;
66 char tmpTemplate[] =
"/tmp/depthai_XXXXXX";
67 char* tmpName = mkdtemp(tmpTemplate);
68 if(tmpName ==
nullptr) {