-
Notifications
You must be signed in to change notification settings - Fork 7
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
Standby support #1
base: master
Are you sure you want to change the base?
Conversation
Adds the description of new parameters for standby use (daemon).
Hi @slepp , You like to merge this? 😕 |
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.
Just some thoughts on how the flow is going and some formatting things.
|
||
Note: For standby use (for example, when running as a daemon), use both flags `-d -r`. | ||
When running in this way the RTL_TCP is only active (reading samples) when some client is connected. | ||
In any order case, the RTL_TCP and RTLMUX processes are in standby (idle). |
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.
Just a spelling mistake on 'order', which should be 'other'.
@@ -10,4 +10,8 @@ option "port" p "rtl_tcp port" | |||
option "host" h "rtl_tcp host address" | |||
string typestr="address" default="localhost" optional | |||
option "listen" l "Listening port for client connections" | |||
int typestr="port" default="7878" optional | |||
int typestr="port" default="7878" optional option "delayed" d "Delayed | |||
connection to the server" |
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 line wrapping (and the next one) causes some issues in formatting for the --help and comments in the cmdline handler.
//bufferevent_free(bev); | ||
//connectToServerSoon(ctx); | ||
//return; | ||
serverInfo.state = SERVER_CONNECTED; |
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.
I don't really see why this is being set to SERVER_CONNECTED
when it hasn't actually happened. This would then go on using the buffer and context on a bad connection. It seems you'd likely just want to use the timeToExit = 2 here.
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.
More or less... yes!
if (timeToExit == 2) { | ||
slog(LOG_INFO, SLOG_INFO, "Restarting."); | ||
timeToExit = 0; | ||
goto restart; |
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 looks like it could be better handled in just a normal loop, like:
do {
pthread_create();
..
pthread_join();
if (timeToExit == 2) {
slog restarting;
timeToExit = 0;
}
} while (timeToExit != 1);
Hi, Sorry, no time for improvements! Feel free to add any modification that you like. |
Adds support for two new parameters. It enables to run it as a daemon in standby when no clients connected.