mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-15 15:16:52 +02:00
Problem: inconsistent error handling and unnecessary code duplication
Solution: make error handling consistent and use retired_fd to remove code duplication
This commit is contained in:
@@ -279,15 +279,9 @@ int zmq::tcp_connecter_t::open ()
|
||||
s = open_socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
}
|
||||
|
||||
#ifdef ZMQ_HAVE_WINDOWS
|
||||
if (s == INVALID_SOCKET) {
|
||||
errno = wsa_error_to_errno (WSAGetLastError ());
|
||||
if (s == retired_fd) {
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
if (s == -1)
|
||||
return -1;
|
||||
#endif
|
||||
|
||||
// On some systems, IPv4 mapping in IPv6 sockets is disabled by default.
|
||||
// Switch it on in such cases.
|
||||
|
Reference in New Issue
Block a user