aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-05-08 14:15:19 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-05-23 09:45:04 +0200
commita60838d09aed4d976e9343e8329d61afff204435 (patch)
treebb7d9b040b6d8b77c3d57fd8abd903ae02d19231 /src/netbase.h
parent8cd900711c0396ac3a96ffd40f43f0e9ec76fadb (diff)
downloadbitcoin-a60838d09aed4d976e9343e8329d61afff204435.tar.xz
Replace non-threadsafe strerror
Log the name of the error as well as the error code if a network problem happens. This makes network troubleshooting more convenient. Use thread-safe strerror_r and the WIN32 equivalent FormatMessage.
Diffstat (limited to 'src/netbase.h')
-rw-r--r--src/netbase.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/netbase.h b/src/netbase.h
index 118f866d6c..5fd8be4aca 100644
--- a/src/netbase.h
+++ b/src/netbase.h
@@ -179,5 +179,7 @@ bool Lookup(const char *pszName, std::vector<CService>& vAddr, int portDefault =
bool LookupNumeric(const char *pszName, CService& addr, int portDefault = 0);
bool ConnectSocket(const CService &addr, SOCKET& hSocketRet, int nTimeout = nConnectTimeout);
bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest, int portDefault = 0, int nTimeout = nConnectTimeout);
+/** Return readable error string for a network error code */
+std::string NetworkErrorString(int err);
#endif