Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for nonblocking sockets? #7

Open
johnnyhh opened this issue Mar 14, 2017 · 2 comments
Open

support for nonblocking sockets? #7

johnnyhh opened this issue Mar 14, 2017 · 2 comments

Comments

@johnnyhh
Copy link

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?

@tonyrog
Copy link
Owner

tonyrog commented Mar 14, 2017

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.

@tonyrog
Copy link
Owner

tonyrog commented Mar 20, 2017

Ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants