Fix setsockopt() error on Windows

refs #12003
This commit is contained in:
Michael Friedrich 2016-07-05 13:16:14 +02:00
parent 208fd535d4
commit 85afec8952
1 changed files with 2 additions and 2 deletions

View File

@ -177,8 +177,8 @@ void TcpSocket::Connect(const String& node, const String& service)
continue; continue;
} }
int optval = 1; const int optTrue = 1;
if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval)) != 0) { if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, reinterpret_cast<const char *>(&optTrue), sizeof(optTrue)) != 0) {
#ifdef _WIN32 #ifdef _WIN32
error = WSAGetLastError(); error = WSAGetLastError();
#else /* _WIN32 */ #else /* _WIN32 */