Open johnnyhh opened 7 years ago
Hi! I think the part of the code is from regular sockets that was nonblocking and when the code was adopted to CAN sockets I assumed that blocking was not an issue. But I am happy to accept a pull request. Thanks.
Ping?
We've been using
can_sock_drv.erl
in a context where the can network can become disconnected, which causes the write() call incan_sock_drv.c
to block before we can restart the interface after detecting aBUS_OFF
error frame. Adding theO_NONBLOCK
flag to the socket incan_sock_drv_start
fixes this issue. Saw someEAGAIN
s in the code, so it seems like at some point you considered using nonblocking sockets? Did you come across any problems with implementing nonblocking sockets that stopped you from using them?