-
Notifications
You must be signed in to change notification settings - Fork 299
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
dlt-receive: add reconnect option #620
dlt-receive: add reconnect option #620
Conversation
Hello @maiananthan |
Sorry not reading carefully, so I suppose I am a user and would rather the client side stay there when I do something like reboot daemon, I think it is good to hang awhile. My concern is:
I am fine with merging this patch. Let see @michael-methner opinion. |
// if reconnect flag is enabled, wait for mentioned milli | ||
// seconds | ||
poll(NULL, 0, dltdata.rvalue); | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the loop stop here? If not, the loop goes on forever!
I suggest my fix, which I applied and checked that it works:
|
@@ -162,6 +168,7 @@ void usage() | |||
printf(" -R Enable resync serial header\n"); | |||
printf(" -y Serial device mode\n"); | |||
printf(" -u UDP multicast mode\n"); | |||
printf(" -r msecs Reconnect server with milli seconds specified\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the wording more precise: "Reconnect to server after milli seconds"
break; | ||
} | ||
} | ||
} while (dltdata.rflag == 1 && poll(NULL, 0, dltdata.rvalue) == 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is somehow duplicated to the poll instruction before. You could use a while(1) instead.
I would prefer sleep() or nanosleep() instead of the poll to implement a sleep function.
Hello @maiananthan |
Duplicated by #640 |
Issue
Fix
-r
) to reconnect dlt-daemon automatically.