12 years, 1 month ago.

CAN read: does it block?

HI,

Simple put, does the CAN .read(..) method block?

Does it have a timeout, and if so what is it?

Is there anywhere I can find the answers to this, or make any changes? i.e. in some header files?

Thanks, Adam.

1 Answer

12 years, 1 month ago.

Hi Adam,

Read is non-blocking. Here is one link to the API.

Depending on your needs, you may also want to look at the attach method, then an inbound message event passes it to your function immediately.

Accepted Answer

Thank you for your response. I had read the API, but it didn't mention anything about it, maybe that implies it doesn't block.

posted by Adam Osborn 11 Sep 2013

I could have been slightly more clear - from the link I provided: "0 if no message arrived" is the return value of read().

posted by David Smart 11 Sep 2013