sebi2k1 / node-can

NodeJS SocketCAN extension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

send non-blocking with `non_block_send` set to `false` or `true`.

milesstoetzner opened this issue · comments

First of all, thank you very much for this library.

I am wondering if there is a mistake in the following documentation of send in can.d.ts (also sendFD).
It states that non_block_send: false should be used for non-blocking sending.
I would assume that one would need to set it to non_block_send: true?
Especially considering the fact, that false is already the default set in createRawChannel and createRawChannelWithOptions.
Do I understand non_block_send wrong?

/**
* Send a CAN message immediately.
*
* PLEASE NOTE: By default, this function may block if the Tx buffer is not available. Please use
* createRawChannelWithOptions({non_block_send: false}) to get non-blocking sending activated.
*
* @method send
* @param message {Object} JSON object describing the CAN message, keys are id, length, data {Buffer}, ext or rtr
*/
send(message: Message): void;

Greetings

You are right indeed. Reviewed the code and TRUE enables MSG_DONTWAIT.