fix: Windows setsockopt needs char* cast

This commit is contained in:
KIU Shueng Chuan 2015-08-07 00:05:13 +08:00
parent ca9215de1e
commit c7f2cdd699

View File

@ -160,10 +160,12 @@ void zmq::tune_tcp_retransmit_timeout (fd_t sockfd_, int timeout_)
#if defined (ZMQ_HAVE_WINDOWS) && defined (TCP_MAXRT)
// msdn says it's supported in >= Vista, >= Windows Server 2003
timeout_ /= 1000; // in seconds
int rc = setsockopt (sockfd_, IPPROTO_TCP, TCP_MAXRT, &timeout_, sizeof(timeout_));
int rc = setsockopt (sockfd_, IPPROTO_TCP, TCP_MAXRT, (char*) &timeout_,
sizeof(timeout_));
wsa_assert (rc != SOCKET_ERROR);
#elif defined (TCP_USER_TIMEOUT) // FIXME: should be ZMQ_HAVE_TCP_USER_TIMEOUT
int rc = setsockopt (sockfd_, IPPROTO_TCP, TCP_USER_TIMEOUT, &timeout_, sizeof(timeout_));
int rc = setsockopt (sockfd_, IPPROTO_TCP, TCP_USER_TIMEOUT, &timeout_,
sizeof(timeout_));
errno_assert (rc == 0);
#endif
}