when calling "recv" defined in "sys_socket.h" it sometimes returns the error
"netErrTimeout" for no apparent reason. By modifing the function that makes
the call to try 3 time before throwing the error it all works fine. But I
want to know why this happens. Has anyone else out there come across the
same problem?

If I set a breakpoint before
"iReceived = recv(lSocket, pbBuffer, *pcbBufferSize, 0);"
the error never occurrs.
<snip>
iReceived = recv(lSocket, pbBuffer, *pcbBufferSize, 0);
if (iReceived == 0 )
    /*Done*/
else if (iReceived < 0)
    printError(errno); /*errno is a global*/
</snip>

but if I change my code to try again it works

<snip>
for (;;)
{
    iReceived = recv (lSocket, pbBuffer, *pcbBufferSize, 0);
    if (iReceived >= 0)
        break; /*we received stuff*/

    /* Retry up to 3 times */
    if (numRetry < 3)
        SysTaskDelay(SysTicksPerSecond() * 2); /* This seems to help. */
    else
        break;
}
/*do stuff*/
</snip>

This seems to work fine for me (the error has not occured since I canged
this). But as I said earlier I would like to know why this happens. Is it an
error in NetLib, could it be my server that isnt properly setup. Any ideas.

PS.
This has happened on different servers but not on all Ive tried on. So right
now I cant give you any specific server setup.

/Rickard E



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to