Skip to content

Commit

Permalink
Merge pull request #304 from TheBlueMatt/cpufix
Browse files Browse the repository at this point in the history
Fix CPU Usage bug when using -nolisten and have no connections.
  • Loading branch information
Jeff Garzik committed Jun 10, 2011
2 parents 2661f2f + c6710c7 commit 65ee333
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,12 @@ void ThreadSocketHandler2(void* parg)
if (nSelect == SOCKET_ERROR)
{
int nErr = WSAGetLastError();
printf("socket select error %d\n", nErr);
for (int i = 0; i <= hSocketMax; i++)
FD_SET(i, &fdsetRecv);
if (hSocketMax > -1)
{
printf("socket select error %d\n", nErr);
for (int i = 0; i <= hSocketMax; i++)
FD_SET(i, &fdsetRecv);
}
FD_ZERO(&fdsetSend);
FD_ZERO(&fdsetError);
Sleep(timeout.tv_usec/1000);
Expand Down

0 comments on commit 65ee333

Please sign in to comment.