Faster timeout when connecting

Use non-blocking connects, and a select() call to wait a predefined
time (5s by default, but configurable with -timeout) for either
success or failure. This allows much more connections to be tried
per time unit.

Based on a patch by phantomcircuit.
This commit is contained in:
Pieter Wuille
2011-06-06 20:35:01 +02:00
parent e051f1b510
commit 76d660ebd3
5 changed files with 93 additions and 3 deletions

View File

@@ -79,7 +79,6 @@ extern int fUseUPnP;
bool CheckDiskSpace(uint64 nAdditionalBytes=0);
FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb");
FILE* AppendBlockFile(unsigned int& nFileRet);