[Live-devel] VS2010 build fails to connect (EWOULDBLOCK vs WSAEWOULDBLOCK)

Scott Taylor scott.taylor at abaslabs.com
Tue Jun 5 01:39:25 PDT 2012


Hi there,

I've just upgraded our live555 version (from 2011.06.12 to 2012.05.17) 
and RTSPClient::connectToServer is failing on Windows. The following 
check fails:

__int const err = envir().getErrno();
if (err == EINPROGRESS || err == EWOULDBLOCK) {
     ...
}

I read Ross Finlayson's response to a previous post 
<http://lists.live555.com/pipermail/live-devel/2012-January/014432.html> 
by Jeff Shanab, where he added EWOULDBLOCK as a platform-independent 
solution. However, it turns out EWOULDBLOCK != WSAEWOULDBLOCK.

_winerror.h_
#define WSAEWOULDBLOCK                   10035L
_errno.h_
#define EWOULDBLOCK     140
_winsock.h / winsock2.h_
#if 0
#define EWOULDBLOCK             WSAEWOULDBLOCK

See this feedback entry 
<http://connect.microsoft.com/VisualStudio/feedback/details/509380/errno-h-socket-return-codes-now-inconsistent-with-wsagetlasterror> 
and MSDN Error Codes 
<http://msdn.microsoft.com/en-us/library/windows/desktop/ms737828%28v=vs.85%29.aspx>. 
Seems like in VS2010 they broke compatibility with Berkeley? The #if 0 
is a bit of a lol. :)

There used to be a workaround in NetCommon.h ln 38, however it is now 
commented out in 2012.05.17:
//#define EWOULDBLOCK WSAEWOULDBLOCK

This results in Windows builds being unable to connect.As a temporary 
workaround, I've changed my NetCommon.h to read:
#undef EWOULDBLOCK
#define EWOULDBLOCK WSAEWOULDBLOCK
#undef EINPROGRESS
#define EINPROGRESS WSAEWOULDBLOCK
#undef EAGAIN
#define EAGAIN WSAEWOULDBLOCK
#undef EINTR
#define EINTR WSAEINTR

This appears to work again. Is this solution correct?

Thanks for your help,
Scott Taylor
immersaview.com



<http://lists.live555.com/pipermail/live-devel/2012-January/014432.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120605/eabc4fb7/attachment.html>


More information about the live-devel mailing list