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.

A quick question about non-blocking and recv-timeout

I have a question that I asked before, and like to confirm again:

If we use non-blocking recv mode,

1. Does timeout work by sl_SetSockOpt(sd,SL_SOL_SOCKET,SL_SO_RCVTIMEO, (_u8 *)&timeVal, sizeof(timeVal)); ?

2. If SL_SO_RCVTIMEO doesn't work, what happens to sl_recv if there is no data in socket? Wait? Is there a default timeout?

Thanks,

Leo

  • Hi,

    1. No, this timeout is not applicable to non-blocking socket.
    2. It is returned code SL_EAGAIN(-11), and you need wait (do what you need, osi_Sleep(), etc.) and call sl_ API later.

    Jan