summaryrefslogtreecommitdiff
path: root/test/basicserver/testbasicserver.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-09-02 11:12:01 +0000
committerChris Wilson <chris+github@qwirx.com>2006-09-02 11:12:01 +0000
commit23fead5de5ef2dc968d46e5a7a4d50f9e36b774a (patch)
treed4ae26971ace26e861a65fcb1cf5b45194b5280e /test/basicserver/testbasicserver.cpp
parent8894575935e9c3ead5ed27674f85eb4911cb85d8 (diff)
(refs #3)
Sleep without nanosleep() on Win32
Diffstat (limited to 'test/basicserver/testbasicserver.cpp')
-rw-r--r--test/basicserver/testbasicserver.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/basicserver/testbasicserver.cpp b/test/basicserver/testbasicserver.cpp
index f5185b96..3360cd20 100644
--- a/test/basicserver/testbasicserver.cpp
+++ b/test/basicserver/testbasicserver.cpp
@@ -31,7 +31,6 @@
#include "MemLeakFindOn.h"
-
#define SERVER_LISTEN_PORT 2003
// in ms
@@ -62,10 +61,14 @@ void basicdaemon::Run()
void testservers_pause_before_reply()
{
- struct timespec t;
- t.tv_sec = 0;
- t.tv_nsec = COMMS_SERVER_WAIT_BEFORE_REPLYING * 1000 * 1000; // convert to ns
- ::nanosleep(&t, NULL);
+#ifdef WIN32
+ Sleep(COMMS_SERVER_WAIT_BEFORE_REPLYING);
+#else
+ struct timespec t;
+ t.tv_sec = 0;
+ t.tv_nsec = COMMS_SERVER_WAIT_BEFORE_REPLYING * 1000 * 1000; // convert to ns
+ ::nanosleep(&t, NULL);
+#endif
}
#define LARGE_DATA_BLOCK_SIZE 19870