Core: Socket::Connect now sets the error description(s)

git-svn-id: svn://ultimatepp.org/upp/trunk@6241 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-08-11 16:17:23 +00:00
parent 2656d1a6da
commit 113820c19f

View file

@ -447,6 +447,7 @@ bool TcpSocket::RawConnect(addrinfo *arp)
SetSockError("connect", -1, "not found");
return false;
}
String err;
for(int pass = 0; pass < 2; pass++) {
addrinfo *rp = arp;
while(rp) {
@ -458,12 +459,15 @@ bool TcpSocket::RawConnect(addrinfo *arp)
mode = CONNECT;
return true;
}
if(err.GetCount())
err << '\n';
err << TcpSocketErrorDesc(GetErrorCode());
Close();
}
rp = rp->ai_next;
}
}
SetSockError("connect", -1, "failed");
SetSockError("connect", -1, Nvl(err, "failed"));
return false;
}