You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've been using can_sock_drv.erl in a context where the can network can become disconnected, which causes the write() call in can_sock_drv.c to block before we can restart the interface after detecting a BUS_OFF error frame. Adding the O_NONBLOCK flag to the socket in can_sock_drv_start fixes this issue. Saw some EAGAINs 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?
The text was updated successfully, but these errors were encountered:
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.
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?The text was updated successfully, but these errors were encountered: