<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
span.keywordflow
{mso-style-name:keywordflow;}
span.keyword
{mso-style-name:keyword;}
span.comment
{mso-style-name:comment;}
span.stringliteral
{mso-style-name:stringliteral;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>I started having problems connecting to some RTSP streams and traced it to line 400 in the RTSPClient<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><pre><a name=l00400></a>00399 if (connect(socketNum, (struct sockaddr*) &remoteName, sizeof remoteName) != 0) {<o:p></o:p></pre><pre>00400 if (envir().getErrno() == EINPROGRESS) {<o:p></o:p></pre><pre>00401 // The connection is pending; we'll need to handle it later. Wait for our socket to be 'writable', or have an exception.<o:p></o:p></pre><pre>00402 envir().taskScheduler().setBackgroundHandling(socketNum, SOCKET_WRITABLE|SOCKET_EXCEPTION,<o:p></o:p></pre><pre>00403 (TaskScheduler::BackgroundHandlerProc*)&connectionHandler, this);<o:p></o:p></pre><pre>00404 return 0;<o:p></o:p></pre><pre>00405 }<o:p></o:p></pre><pre>00406 envir().setResultErrMsg("connect() failed: ");<o:p></o:p></pre><pre>00407 if (fVerbosityLevel >= 1) envir() << "..." << envir().getResultMsg() << "\n";<o:p></o:p></pre><pre>00408 return -1;<o:p></o:p></pre><pre>00409 }<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>My windows API started returning WSAEWOULDBLOCK which according to MSDN is fine to be rescheduled for later <o:p></o:p></pre><pre><o:p> </o:p></pre><pre>WSAEWOULDBLOCK = 10035<o:p></o:p></pre><pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre>Resource temporarily unavailable.<o:p></o:p></pre><pre><o:p> </o:p></pre><pre> This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established.<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Should I change the if clause on line 400? Or did I somehow mess up the sockets on my computer.<o:p></o:p></pre><pre>I have rebooted, there was a windows update this am. I am on Win7 64bit but running a win32 app.<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>I noticed the setupStreams enables non-blocking sockets by default<o:p></o:p></pre><pre><o:p> </o:p></pre><p class=MsoNormal><o:p> </o:p></p></div></body></html>