mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Workaround broken connect implementation.
This commit is contained in:
parent
5ccd62ced8
commit
f7727f3aa4
@ -113,7 +113,8 @@ bool Socket::Connect( const char* addr, int port )
|
||||
if( m_ptr )
|
||||
{
|
||||
const auto c = connect( m_connSock, m_ptr->ai_addr, m_ptr->ai_addrlen );
|
||||
assert( c == -1 );
|
||||
if( c == -1 )
|
||||
{
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
const auto err = WSAGetLastError();
|
||||
if( err == WSAEALREADY || err == WSAEINPROGRESS ) return false;
|
||||
@ -125,14 +126,16 @@ bool Socket::Connect( const char* addr, int port )
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if( errno == EALREADY || errno == EINPROGRESS ) return false;
|
||||
if( errno != EISCONN )
|
||||
const auto err = errno;
|
||||
if( err == EALREADY || err == EINPROGRESS ) return false;
|
||||
if( err != EISCONN )
|
||||
{
|
||||
freeaddrinfo( m_res );
|
||||
close( m_connSock );
|
||||
m_ptr = nullptr;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
|
Loading…
Reference in New Issue
Block a user