Skip to content

capture OSErrors while receiving data - #87

Merged
hardbyte merged 2 commits into
hardbyte:developfrom
umlaeute:catch-recv
Oct 19, 2016
Merged

capture OSErrors while receiving data#87
hardbyte merged 2 commits into
hardbyte:developfrom
umlaeute:catch-recv

Conversation

@umlaeute

Copy link
Copy Markdown
Contributor

both sock.recv() and select.select(sock) both throw errors when the device
to which the socket is bound goes down.
this patch should make the notifier thread survive such a condition
(and bail out on the log)

Closes: #86

both sock.recv() and select.select(sock) throw errors when the device
to which the socket is bound goes down.
this patch should make the notifier thread survive such a condition
(and bail out on the log)

Closes: #86
@umlaeute

Copy link
Copy Markdown
Contributor Author

btw, this code is slightly untested as it is a cleaned up version of what i actually used (the original hacked version would catch any Exception (rather than just an OSError) and wrap almost the entire body of SocketcanNative_Bus.recv into a a big try/catch clause.

i'm pretty confident that the code does work though, but have currently no possibility to actually test it.

@hardbyte hardbyte left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@hardbyte
hardbyte merged commit 192d730 into hardbyte:develop Oct 19, 2016
@umlaeute
umlaeute deleted the catch-recv branch October 28, 2016 08:57
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

Successfully merging this pull request may close these issues.

2 participants