diff --git a/src/main.cpp b/src/main.cpp index fa84f54..16ebad4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,8 +46,13 @@ DWORD WINAPI recvTh(LPVOID) auto buf = std::make_unique(BUF_SIZE); printf("Started thread\n"); - u_long iMode = 1; - ioctlsocket(sock, FIONBIO, &iMode); + u_long iMode = 0; + int ioctlResult = ioctlsocket(sock, FIONBIO, &iMode); + if (ioctlResult != 0) + { + printf("ioctlsocket error: %d\n", ioctlResult); + return 1; + } sockaddr_in sender{}; int senderSize = sizeof(sender); @@ -83,6 +88,8 @@ DWORD WINAPI recvTh(LPVOID) Sleep(1); } + + return 0; } int main(int, char**)