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?
We've been using
can_sock_drv.erlin a context where the can network can become disconnected, which causes the write() call incan_sock_drv.cto block before we can restart the interface after detecting aBUS_OFFerror frame. Adding theO_NONBLOCKflag to the socket incan_sock_drv_startfixes this issue. Saw someEAGAINs 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?