fix mqtt receive on proxspace
This commit is contained in:
1 parent
931e93a11b
commit
815d445382
1 file changed
+4
-4
@@ -45,7 +45,7 @@ int open_nb_socket(const char *addr, const char *port) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// connect to server
|
// connect to server
|
||||||
if (connect(hSocket, p->ai_addr, (int)p->ai_addrlen) != INVALID_SOCKET) {
|
if (connect(hSocket, p->ai_addr, (int)p->ai_addrlen) != INVALID_SOCKET) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ int open_nb_socket(const char *addr, const char *port) {
|
|||||||
|
|
||||||
// make non-blocking
|
// make non-blocking
|
||||||
if (hSocket != INVALID_SOCKET) {
|
if (hSocket != INVALID_SOCKET) {
|
||||||
uint32_t mode; // FIONBIO returns size on 32b
|
uint32_t mode = 1; // FIONBIO returns size on 32b
|
||||||
ioctlsocket(hSocket, FIONBIO, (u_long *)&mode);
|
ioctlsocket(hSocket, FIONBIO, (u_long *)&mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ int open_nb_socket(const char *addr, const char *port) {
|
|||||||
closesocket(hSocket);
|
closesocket(hSocket);
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return hSocket;
|
return hSocket;
|
||||||
}
|
}
|
||||||
@@ -88,4 +88,4 @@ void close_nb_socket(int sockfd) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user