This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Meet with EWOULDBLOCK error when use recvnc socket command

Other Parts Discussed in Thread: AM3359

Hello,

        We are developing a project using raweth protocal .At the begging , The socket looks running OK.But after some seconds, ti will give EWOULDBLOCK error(35). The faster we tried to receive the packet the sooner the NDK will give the error. But after give the error it can run again for a while, then it will give error again and on and on.

        We have also tried to enlarge the PBM size in NDK setting page. It can make the NDK to maintain the running longer. But it wil still fail and give error.

My code is like this:

fdShare(socket_rcv);

/* Retrieve the packets */
bytesrx = (int)recvnc( socket_rcv, (void**)&(pkt_data), 0, &hBuffer );

if(bytesrx >= 0)
{
        port->tempinbufs = bytesrx;
        memcpy(stack->tempbuf, pkt_data, bytesrx); //give data received
        recvncfree(hBuffer);
}
else
{
        port->tempinbufs = 0;
        memcpy(stack->tempbuf, pkt_data, EC_BUFSIZE); //give 0
        //Display the errors
        error = fdError();
        ConsoleUtilsPrintf("\nError Receiving the packet: %d\n", error);
}

fdClose(socket_rcv);

NDK tick period is 10.(10ms)

receive task period is 100ms

MY SDCtools version: 3.25.0.48

SYSBIOS version: 6.35.1.29

NDK Core versison:2.22.3.20

am3359 ind sdk version : 1.1.0.3

  • Bin Hu1 said:
    The socket looks running OK.But after some seconds, ti will give EWOULDBLOCK error(35

     Hi, on socket programming all error like EWOULDBLOCK equivalent to EAGAIN must be trapped and an action performed, a short sleep is more better than waste computing power to print message about error the purpose was to continue processing.