Changeset 355 for code/branches/FICN
- Timestamp:
- Nov 29, 2007, 6:13:47 PM (17 years ago)
- Location:
- code/branches/FICN/src/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/ClientConnection.cc
r352 r355 12 12 #include "ClientConnection.h" 13 13 14 // workaround for usleep(int) under windows15 14 #ifdef WIN32 16 #include "winbase.h" 15 #include <windows.h> 16 #define usleep(x) Sleep((x)/1000) 17 #else 18 #include <unistd.h> 17 19 #endif 18 20 … … 39 41 bool ClientConnection::waitEstablished(int milisec){ 40 42 for(int i=0; i<=milisec && !established; i++) 41 // under windows, use Sleep(milliseconds) instead of usleep(microseconds)42 #ifdef WIN3243 Sleep(1);44 #else45 43 usleep(1000); 46 #endif 44 47 45 return established; 48 46 } -
code/branches/FICN/src/network/PacketBufferTestExt.cc
r351 r355 7 7 8 8 using namespace network; 9 10 // workaround for usleep(int) under windows11 #ifdef WIN3212 #include "winbase.h"13 #endif14 9 15 10 … … 27 22 test->push(&event); 28 23 if(i==5) 29 // under windows, use Sleep(milliseconds) instead of usleep(microseconds)30 #ifdef WIN3231 Sleep(200);32 #else33 24 usleep(200000); 34 #endif35 25 } 36 26 test->setClosed(true); -
code/branches/FICN/src/network/dummyclient.cc
r346 r355 8 8 #include <enet/enet.h> 9 9 #include "PacketManager.h" 10 11 // workaround for usleep(int) under windows12 #ifdef WIN3213 #include "winbase.h"14 #endif15 10 16 11 … … 73 68 cout << "failed sending" << endl; 74 69 } 75 // under windows, use Sleep(milliseconds) instead of usleep(microseconds)76 #ifdef WIN3277 Sleep(1000);78 #else79 70 usleep(1000000); 80 #endif81 71 } 82 72 -
code/branches/FICN/src/network/dummyserver.cc
r352 r355 9 9 #include "ConnectionManager.h" 10 10 #include "PacketManager.h" 11 12 // workaround for usleep(int) under windows13 #ifdef WIN3214 #include "winbase.h"15 #endif16 11 17 12 … … 28 23 while(!quit){ 29 24 if(server.queueEmpty()) 30 // under windows, use Sleep(milliseconds) instead of usleep(microseconds) 31 // Warning: Sleep(1) is ten times longer than usleep(100)! 32 #ifdef WIN32 33 Sleep(1); 34 #else 25 // Warning: usleep(100) under windows is ten times longer than with unix! 35 26 usleep(100); 36 #endif37 27 else{ 38 28 ENetAddress addr;
Note: See TracChangeset
for help on using the changeset viewer.