1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-19 01:04:20 +00:00
This commit is contained in:
jules 2008-01-14 13:43:23 +00:00
parent a082f55e32
commit 200197c95c

View file

@ -178,16 +178,32 @@ static int waitForReadiness (const int handle, const bool forReading,
if (select (handle + 1, prset, pwset, 0, timeoutp) < 0)
return -1;
#else
int result;
while ((result = select (handle + 1, prset, pwset, 0, timeoutp)) < 0
&& errno == EINTR)
{
}
int result;
while ((result = select (handle + 1, prset, pwset, 0, timeoutp)) < 0
&& errno == EINTR)
{
}
if (result < 0)
return -1;
if (result < 0)
return -1;
}
#endif
{
int opt;
#if defined (JUCE_LINUX) || (defined (JUCE_MAC) && ! MACOS_10_2_OR_EARLIER)
socklen_t len = sizeof (opt);
#else
int len = sizeof (opt);
#endif
if (getsockopt (handle, SOL_SOCKET, SO_ERROR, (char*) &opt, &len) < 0
|| opt != 0)
return -1;
}
if ((forReading && FD_ISSET (handle, &rset))
|| ((! forReading) && FD_ISSET (handle, &wset)))
return 1;
@ -266,7 +282,7 @@ static bool connectSocket (int volatile& handle,
#if JUCE_WIN32
if (result == SOCKET_ERROR && WSAGetLastError() == WSAEWOULDBLOCK)
#else
if (result == EINPROGRESS)
if (errno == EINPROGRESS)
#endif
{
if (waitForReadiness (handle, false, timeOutMillisecs) != 1)