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.

SOCKOPT_RECV_TIMEOUT

the document for setsocketopt says this particular option is supported, and it's value is passed as a pointer to unsigned long....

what is the underlying unit of time???   milliseconds or microseconds???   and what happens if the time value is zero (does recv/recvfrom return immediately)

what status code comes back from recv/recvfrom if the timeout has expired before data arrives??

and is the feature truly working today??

thanks,

bob.

  • Hi Bob,

    Thanks a lot for comments.

    The timeout is provided in 10 of milli.

    In case a timeout occurs than no error is raised but the receive/receive from is returns with 0 ready bytes.

    If the timeout is 0 the function will return almost immediately, but it is better not to use the 0 value.

    Regards

    Igor

  • thanks igor, everything appears to work....

    as for the timeout of 0, i don't plan to poll continuously; rather, i plan to poll at a frequency suitable for my app....   i actually *want* the function to return immediately -- so i can then determine that i really want to go back sleep, etc....    since the app is doing many things, having this fine-grained level of control actually helps...