diff options
Diffstat (limited to 'src/tcp_connecter.cpp')
-rw-r--r-- | src/tcp_connecter.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/tcp_connecter.cpp b/src/tcp_connecter.cpp index d6f73ca..6bc1b2d 100644 --- a/src/tcp_connecter.cpp +++ b/src/tcp_connecter.cpp @@ -50,7 +50,7 @@ int zmq::tcp_connecter_t::set_address (const char *protocol_, const char *addr_) return resolve_ip_hostname (&addr, &addr_len, addr_); errno = EPROTONOSUPPORT; - return -1; + return -1; } int zmq::tcp_connecter_t::open () @@ -58,7 +58,7 @@ int zmq::tcp_connecter_t::open () zmq_assert (s == retired_fd); // Create the socket. - s = socket (addr.ss_family, SOCK_STREAM, IPPROTO_TCP); + s = open_socket (addr.ss_family, SOCK_STREAM, IPPROTO_TCP); if (s == INVALID_SOCKET) { wsa_error_to_errno (); return -1; @@ -88,7 +88,7 @@ int zmq::tcp_connecter_t::open () errno = EAGAIN; return -1; } - + wsa_error_to_errno (); return -1; } @@ -162,7 +162,8 @@ int zmq::tcp_connecter_t::set_address (const char *protocol_, const char *addr_) { if (strcmp (protocol_, "tcp") == 0) return resolve_ip_hostname (&addr, &addr_len, addr_); - else if (strcmp (protocol_, "ipc") == 0) + else + if (strcmp (protocol_, "ipc") == 0) return resolve_local_path (&addr, &addr_len, addr_); errno = EPROTONOSUPPORT; @@ -177,7 +178,7 @@ int zmq::tcp_connecter_t::open () if (AF_UNIX != sa->sa_family) { // Create the socket. - s = socket (sa->sa_family, SOCK_STREAM, IPPROTO_TCP); + s = open_socket (sa->sa_family, SOCK_STREAM, IPPROTO_TCP); if (s == -1) return -1; @@ -233,13 +234,13 @@ int zmq::tcp_connecter_t::open () // Create the socket. zmq_assert (AF_UNIX == sa->sa_family); - s = socket (AF_UNIX, SOCK_STREAM, 0); + s = open_socket (AF_UNIX, SOCK_STREAM, 0); if (s == -1) return -1; // Set the non-blocking flag. int flag = fcntl (s, F_GETFL, 0); - if (flag == -1) + if (flag == -1) flag = 0; int rc = fcntl (s, F_SETFL, flag | O_NONBLOCK); errno_assert (rc != -1); |