Bugfix for connecting to invalid IP Address will now properly detect a failed connection attempt.

This commit is contained in:
Mark Vejvoda
2010-03-11 17:45:39 +00:00
parent 4ecc284f75
commit cb0ea38d74
3 changed files with 31 additions and 12 deletions

View File

@@ -683,7 +683,7 @@ void ClientSocket::connect(const Ip &ip, int port)
fprintf(stderr, "%s\n", WSAGetLastErrorMessage(szBuf));
//fprintf(stderr, "%s", szBuf);
if (WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK)
if (WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK)
{
fd_set myset;
struct timeval tv;
@@ -746,7 +746,8 @@ void ClientSocket::connect(const Ip &ip, int port)
if(err < 0)
{
fprintf(stderr, "In [%s::%s] Before END sock = %d, err = %d, errno = %d\n",__FILE__,__FUNCTION__,sock,err,WSAGetLastError());
//throwException(szBuf);
//throwException(szBuf);
disconnectSocket();
}
fprintf(stderr, "Valid recovery for connection sock = %d, err = %d, WSAGetLastError() = %d\n",sock,err,WSAGetLastError());