-
Notifications
You must be signed in to change notification settings - Fork 16
Feat: reconnect socket in case of failure in socket output #17
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
Feat: reconnect socket in case of failure in socket output #17
Conversation
Otherwise the sensor stops when the socket output write to an already closed socket.
This does work but is still a work in progress and lacks proper handling of corner cases.
Retry should be implemented by the caller, not in `socket_connection`. Instead, `socket_initialize` now implements a retry loop.
When writing a message on the socket fails, start the reconnection mechanism.
It is supposed to be good practice to create a new socket every time we try to connect, instead of reusing the previous one.
hum, there has been a full reformat on Is there a recommended / required formatting tool, in order to avoid such issue ? By the way, the new formatting style of this file is now different from the style in all other files... Is that expected ? For example:
|
Merge mostly due to full reformat on storage_socket.c
Sorry, I fixed a warning treated as an error (two declaration on a same line) and it seams that my auto-format did some nasty things... |
ok, I've pushed a merge where I force the previous formatting style. I'm afraid I have reintroduced the two declarations on the same line, I'll push a fix for that but I don't see the CI complaining, where can I find that ? Still, it would be a good thing to agree on a common tool for formatting, I'm clearly not sure my formatting is consistent either ... |
This PR is meant to fix #11 and is still a work in progress and should not be merged yet !
The basic mechanism works but there are some missing things: