cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLINFO_OS_ERRNO does not change its value after network reconnection

From: <centrio_at_gmail.com>
Date: Mon, 13 Jul 2009 11:09:58 +0000

Hi,
I am having a scenario in which a connection is established with the server
and network cable is unplugged from the machine. In that case I use
following code to know the status of connection.

void f()
{
long conStatus;
CURLcode status =
curl_easy_getinfo(sessionData->curlEasyHandle,CURLINFO_OS_ERRNO,
&conStatus);
if (CURLE_OK == status)
{
if (0 != conStatus)
{
sessionData->endOfMedia = true;
sessionData->internalBufferUsed = 0;
throw systemException("No Connection to host");
}
}
}
The problem I am facing currently is that, once the systemException is
thrown, next time if I try to connect and call f(), i get non zero
conStatus even if I have plugged the cable back into the machine.
Some how the change at harware level is not getting reflected. Am I using
it wrongly, or is it some problem. I am running this code on windows XP.
Please help.
Received on 2009-07-13