Commit 541af523 authored by louiz’'s avatar louiz’

Consider that the connect() succeded if errno EISCONN

Apparently on some systems, subsquent connect() calls may fail with EISCONN
error, to indicate that the connection succeded in the background, instead
of returning 0.
parent 730cc6e1
......@@ -97,7 +97,8 @@ void SocketHandler::connect(const std::string& address, const std::string& port)
for (struct addrinfo* rp = addr_res; rp; rp = rp->ai_next)
{
if (::connect(this->socket, rp->ai_addr, rp->ai_addrlen) == 0)
if (::connect(this->socket, rp->ai_addr, rp->ai_addrlen) == 0
|| errno == EISCONN)
{
log_info("Connection success.");
this->connected = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment