0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-26 23:01:04 +08:00

Problem: ZMQ_SRCFD test does not work on Windows

Solution: add Winsock specific assertions, since getpeername() should will
return SOCKET_ERROR (-1) and WSAGetLastError() will be set to WSAENOTSOCK
This commit is contained in:
hitstergtd 2016-04-21 13:08:50 +01:00
parent 317499edae
commit e8aeb3686d

View File

@ -105,8 +105,13 @@ int main (void)
// getting name from closed socket will fail
rc = getpeername (srcFd, (struct sockaddr*) &ss, &addrlen);
#ifdef ZMQ_HAVE_WINDOWS
assert (rc == SOCKET_ERROR);
assert (WSAGetLastError() == WSAENOTSOCK);
#else
assert (rc == -1);
assert (errno == EBADF);
#endif
rc = zmq_ctx_term (ctx);
assert (rc == 0);