Fix Windows Compilation

This commit is contained in:
Phenom 2017-05-28 12:57:36 +02:00
parent 873131f487
commit 28119b5094
3 changed files with 6 additions and 9 deletions

View File

@ -1,4 +1,5 @@
#include <sstream>
#include <unistd.h> /* for usleep() */
#include "p3i2pbob.h"
@ -38,11 +39,7 @@ static struct RsLog::logInfo i2pBobLogInfo = {RsLog::Debug_All, "p3I2pBob"};
static const time_t selfCheckPeroid = 30;
void doSleep(useconds_t timeToSleepMS) {
#ifndef WINDOWS_SYS
usleep((useconds_t) (timeToSleepMS * 1000));
#else
Sleep((int) (timeToSleepMS));
#endif
}
p3I2pBob::p3I2pBob(p3PeerMgr *peerMgr)

View File

@ -4,8 +4,10 @@
#include <map>
#include <queue>
#include <sys/types.h>
#include <sys/socket.h>
#include <time.h>
#ifndef WINDOWS_SYS
#include <sys/socket.h>
#endif
#include "services/autoproxy/rsautoproxymonitor.h"
#include "util/rsthreads.h"

View File

@ -1,5 +1,7 @@
#include "rsautoproxymonitor.h"
#include <unistd.h> /* for usleep() */
rsAutoProxyMonitor *rsAutoProxyMonitor::mInstance = NULL;
rsAutoProxyMonitor::rsAutoProxyMonitor()
@ -91,11 +93,7 @@ void rsAutoProxyMonitor::stopAllRSShutdown()
// wait for shutdown of all services
uint32_t t = 0, timeout = 15;
do {
#ifndef WINDOWS_SYS
usleep(1000 * 1000);
#else
Sleep(1000);
#endif
RS_STACK_MUTEX(mLock);
std::cout << "(II) waiting for auto proxy service(s) to shut down " << t << "/" << timeout << " (remaining: " << mProxies.size() << ")" << std::endl;
if (mProxies.empty())