Bugfix: Deal with error code for bind()

This commit is contained in:
Gunnar Beutner 2012-05-08 09:44:58 +02:00
parent e7a718ac11
commit 8a5e1423ca
2 changed files with 8 additions and 4 deletions

View File

@ -60,11 +60,15 @@ void TCPSocket::Bind(string node, string service, int family)
int rc = ::bind(fd, info->ai_addr, info->ai_addrlen); int rc = ::bind(fd, info->ai_addr, info->ai_addrlen);
#ifdef _WIN32 #ifdef _WIN32
if (rc < 0 && WSAGetLastError() != WSAEWOULDBLOCK) if (rc < 0 && WSAGetLastError() != WSAEWOULDBLOCK) {
#else /* _WIN32 */ #else /* _WIN32 */
if (rc < 0 && errno != EINPROGRESS) if (rc < 0 && errno != EINPROGRESS) {
#endif /* _WIN32 */ #endif /* _WIN32 */
closesocket(fd);
SetFD(INVALID_SOCKET);
continue; continue;
}
break; break;
} }

View File

@ -5,7 +5,7 @@
"pubkey": "icinga-c3.crt", "pubkey": "icinga-c3.crt",
"cakey": "ca.crt", "cakey": "ca.crt",
"node": "10.0.10.14", "node": "10.0.10.14",
"service": "8888" "service": "9999"
} }
}, },
"component": { "component": {
@ -14,7 +14,7 @@
"discovery": { "replicate": "0", "broker": "0" } "discovery": { "replicate": "0", "broker": "0" }
}, },
"rpclistener": { "rpclistener": {
"kekslistener": { "replicate": "0", "service": "8888" } "kekslistener": { "replicate": "0", "service": "9999" }
}, },
"broker": { "broker": {
"icinga-c1": { "replicate": "0", "node": "10.0.10.3", "service": "7777" } "icinga-c1": { "replicate": "0", "node": "10.0.10.3", "service": "7777" }