From 5dc8b51ceb88f14fff1f8b1fccae749c7c087506 Mon Sep 17 00:00:00 2001 From: PP Date: Thu, 17 Sep 2015 16:59:25 +0800 Subject: [PATCH] Fixed the bug which cause the application crashed when use TCP connect to an invalid address(such as 192.168.1.255). --- src/tcp_connecter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tcp_connecter.cpp b/src/tcp_connecter.cpp index 60a6e452..b8d62a2d 100644 --- a/src/tcp_connecter.cpp +++ b/src/tcp_connecter.cpp @@ -355,7 +355,8 @@ zmq::fd_t zmq::tcp_connecter_t::connect () && err != WSAENETDOWN && err != WSAEACCES && err != WSAEINVAL - && err != WSAEADDRINUSE) + && err != WSAEADDRINUSE + && err != WSAEADDRNOTAVAIL) { wsa_assert_no (err); } @@ -375,7 +376,8 @@ zmq::fd_t zmq::tcp_connecter_t::connect () errno == EHOSTUNREACH || errno == ENETUNREACH || errno == ENETDOWN || - errno == EINVAL); + errno == EINVAL || + errno == EADDRNOTAVAIL); return retired_fd; } #endif