Skip to content

Commit

Permalink
Fixing breadcrumbs server after data sync thread changes
Browse files Browse the repository at this point in the history
  • Loading branch information
grf14003 committed Jan 29, 2020
1 parent a53e2bc commit dc5f87d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions breadcrumbs/src/comms/DataSyncThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ void DataSyncThread::threadRuntime()
attribMutex = NULL;
}

WSACleanup();
printf("Done running thread!");
printf("Done running data sync thread!\n");
threadRunning = false;
}

Expand All @@ -69,7 +68,10 @@ bool DataSyncThread::readyToReceive(int interval)
tv.tv_sec = interval;
tv.tv_usec = 0;

return (select(sock + 1, &fds, 0, 0, &tv) == 1);
bool result = select(sock + 1, &fds, 0, 0, &tv) == 1;
if (FD_ISSET(sock, &fds))
return true;
return result;
}

int DataSyncThread::recvBytes(void* buffer, size_t numBytes)
Expand Down
1 change: 1 addition & 0 deletions breadcrumbs/src/main/VirtualOutputProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ int main()
}

client.stopComms();
WSACleanup();

return 0;
}

0 comments on commit dc5f87d

Please sign in to comment.