@ -165,7 +165,7 @@ bool RecvLine(SOCKET hSocket, string& strLine)
@@ -165,7 +165,7 @@ bool RecvLine(SOCKET hSocket, string& strLine)
continue ;
if ( nErr = = WSAEWOULDBLOCK | | nErr = = WSAEINTR | | nErr = = WSAEINPROGRESS )
{
Sleep ( 10 ) ;
Milli Sleep( 10 ) ;
continue ;
}
}
@ -909,7 +909,7 @@ void ThreadSocketHandler2(void* parg)
@@ -909,7 +909,7 @@ void ThreadSocketHandler2(void* parg)
}
FD_ZERO ( & fdsetSend ) ;
FD_ZERO ( & fdsetError ) ;
Sleep ( timeout . tv_usec / 1000 ) ;
Milli Sleep( timeout . tv_usec / 1000 ) ;
}
@ -1076,7 +1076,7 @@ void ThreadSocketHandler2(void* parg)
@@ -1076,7 +1076,7 @@ void ThreadSocketHandler2(void* parg)
pnode - > Release ( ) ;
}
Sleep ( 10 ) ;
Milli Sleep( 10 ) ;
}
}
@ -1197,7 +1197,7 @@ void ThreadMapPort2(void* parg)
@@ -1197,7 +1197,7 @@ void ThreadMapPort2(void* parg)
else
printf ( " UPnP Port Mapping successful. \n " ) ; ;
}
Sleep ( 2000 ) ;
Milli Sleep( 2000 ) ;
i + + ;
}
} else {
@ -1208,7 +1208,7 @@ void ThreadMapPort2(void* parg)
@@ -1208,7 +1208,7 @@ void ThreadMapPort2(void* parg)
loop {
if ( fShutdown | | ! fUseUPnP )
return ;
Sleep ( 2000 ) ;
Milli Sleep( 2000 ) ;
}
}
}
@ -1418,7 +1418,7 @@ void ThreadDumpAddress2(void* parg)
@@ -1418,7 +1418,7 @@ void ThreadDumpAddress2(void* parg)
{
DumpAddresses ( ) ;
vnThreadsRunning [ THREAD_DUMPADDRESS ] - - ;
Sleep ( 100000 ) ;
Milli Sleep( 100000 ) ;
vnThreadsRunning [ THREAD_DUMPADDRESS ] + + ;
}
vnThreadsRunning [ THREAD_DUMPADDRESS ] - - ;
@ -1494,12 +1494,12 @@ void ThreadOpenConnections2(void* parg)
@@ -1494,12 +1494,12 @@ void ThreadOpenConnections2(void* parg)
OpenNetworkConnection ( addr , NULL , strAddr . c_str ( ) ) ;
for ( int i = 0 ; i < 10 & & i < nLoop ; i + + )
{
Sleep ( 500 ) ;
Milli Sleep( 500 ) ;
if ( fShutdown )
return ;
}
}
Sleep ( 500 ) ;
Milli Sleep( 500 ) ;
}
}
@ -1510,7 +1510,7 @@ void ThreadOpenConnections2(void* parg)
@@ -1510,7 +1510,7 @@ void ThreadOpenConnections2(void* parg)
ProcessOneShot ( ) ;
vnThreadsRunning [ THREAD_OPENCONNECTIONS ] - - ;
Sleep ( 500 ) ;
Milli Sleep( 500 ) ;
vnThreadsRunning [ THREAD_OPENCONNECTIONS ] + + ;
if ( fShutdown )
return ;
@ -1642,12 +1642,12 @@ void ThreadOpenAddedConnections2(void* parg)
@@ -1642,12 +1642,12 @@ void ThreadOpenAddedConnections2(void* parg)
CAddress addr ;
CSemaphoreGrant grant ( * semOutbound ) ;
OpenNetworkConnection ( addr , & grant , strAddNode . c_str ( ) ) ;
Sleep ( 500 ) ;
Milli Sleep( 500 ) ;
if ( fShutdown )
return ;
}
vnThreadsRunning [ THREAD_ADDEDCONNECTIONS ] - - ;
Sleep ( 120000 ) ; // Retry every 2 minutes
Milli Sleep( 120000 ) ; // Retry every 2 minutes
vnThreadsRunning [ THREAD_ADDEDCONNECTIONS ] + + ;
}
return ;
@ -1694,14 +1694,14 @@ void ThreadOpenAddedConnections2(void* parg)
@@ -1694,14 +1694,14 @@ void ThreadOpenAddedConnections2(void* parg)
{
CSemaphoreGrant grant ( * semOutbound ) ;
OpenNetworkConnection ( CAddress ( vserv [ i % vserv . size ( ) ] ) , & grant ) ;
Sleep ( 500 ) ;
Milli Sleep( 500 ) ;
if ( fShutdown )
return ;
}
if ( fShutdown )
return ;
vnThreadsRunning [ THREAD_ADDEDCONNECTIONS ] - - ;
Sleep ( 120000 ) ; // Retry every 2 minutes
Milli Sleep( 120000 ) ; // Retry every 2 minutes
vnThreadsRunning [ THREAD_ADDEDCONNECTIONS ] + + ;
if ( fShutdown )
return ;
@ -1821,7 +1821,7 @@ void ThreadMessageHandler2(void* parg)
@@ -1821,7 +1821,7 @@ void ThreadMessageHandler2(void* parg)
// Reduce vnThreadsRunning so StopNode has permission to exit while
// we're sleeping, but we must always check fShutdown after doing this.
vnThreadsRunning [ THREAD_MESSAGEHANDLER ] - - ;
Sleep ( 100 ) ;
Milli Sleep( 100 ) ;
if ( fRequestShutdown )
StartShutdown ( ) ;
vnThreadsRunning [ THREAD_MESSAGEHANDLER ] + + ;
@ -2068,7 +2068,7 @@ bool StopNode()
@@ -2068,7 +2068,7 @@ bool StopNode()
break ;
if ( GetTime ( ) - nStart > 20 )
break ;
Sleep ( 20 ) ;
Milli Sleep( 20 ) ;
} while ( true ) ;
if ( vnThreadsRunning [ THREAD_SOCKETHANDLER ] > 0 ) printf ( " ThreadSocketHandler still running \n " ) ;
if ( vnThreadsRunning [ THREAD_OPENCONNECTIONS ] > 0 ) printf ( " ThreadOpenConnections still running \n " ) ;
@ -2082,8 +2082,8 @@ bool StopNode()
@@ -2082,8 +2082,8 @@ bool StopNode()
if ( vnThreadsRunning [ THREAD_ADDEDCONNECTIONS ] > 0 ) printf ( " ThreadOpenAddedConnections still running \n " ) ;
if ( vnThreadsRunning [ THREAD_DUMPADDRESS ] > 0 ) printf ( " ThreadDumpAddresses still running \n " ) ;
while ( vnThreadsRunning [ THREAD_MESSAGEHANDLER ] > 0 | | vnThreadsRunning [ THREAD_RPCHANDLER ] > 0 )
Sleep ( 20 ) ;
Sleep ( 50 ) ;
Milli Sleep( 20 ) ;
Milli Sleep( 50 ) ;
DumpAddresses ( ) ;
return true ;