Hi,
In C++ how can you use threads to not block my receive functionality in case of Sockets?
// Receive until the peer closes the connection
do {
iResult = recv(lhSocket, recvbuf, recvbuflen, 0);
if ( iResult > 0 )
printf("Bytes received: %d\n", iResult);
else if ( iResult == 0 )
printf("Connection closed\n");
else
printf("recv failed: %d\n", WSAGetLastError());
} while( iResult > 0 );
closesocket(lhSocket);
WSACleanup();