Home » Extra libraries, Code snippets, applications etc. » OS Problems etc., Win32, POSIX, MacOS, FreeBSD, X11 etc » [BUG - solved?] HttpRequest fails under FreeBSD
Re: [BUG] HttpRequest fails under FreeBSD [message #38873 is a reply to message #38872] |
Thu, 24 January 2013 22:39   |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |

|
|
After a bunch of experiments I've finally come to code which works under one of my test FreeBSD systems I currently work in. Tomorrow I'll test it under different FreebBSD system to be absolutely sure about it.
For now, here is WouldBlock() function which seems like a solution:
bool TcpSocket::WouldBlock()
{
int c = GetErrorCode();
#ifdef PLATFORM_POSIX
#ifdef PLATFORM_BSD
if(c == SOCKERR(ENOTCONN))
return true;
#endif
return c == SOCKERR(EWOULDBLOCK) || c == SOCKERR(EAGAIN);
#endif
#ifdef PLATFORM_WIN32
if(c == SOCKERR(ENOTCONN) && !IsNull(connection_start) && msecs(connection_start) < 20000) {
LLOG("ENOTCONN issue");
return true;
}
return c == SOCKERR(EWOULDBLOCK);
#endif
}
[Updated on: Thu, 24 January 2013 22:40] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Apr 26 01:23:55 CEST 2025
Total time taken to generate the page: 0.00810 seconds
|