New option to cap the max wait between reconnection attempts. Still default to 10s. (setMaxWaitBetweenReconnectionRetries) (#108)

This commit is contained in:
Benjamin Sergeant
2019-08-30 12:46:35 -07:00
committed by GitHub
parent 0c1f2252a1
commit 7a73ec7c06
12 changed files with 139 additions and 28 deletions

View File

@ -89,6 +89,7 @@ int main(int argc, char** argv)
int delayMs = -1;
int count = 1;
int jobs = 4;
uint32_t maxWaitBetweenReconnectionRetries;
CLI::App* sendApp = app.add_subcommand("send", "Send a file");
sendApp->add_option("url", url, "Connection url")->required();
@ -113,6 +114,7 @@ int main(int argc, char** argv)
connectApp->add_flag("-d", disableAutomaticReconnection, "Disable Automatic Reconnection");
connectApp->add_flag("-x", disablePerMessageDeflate, "Disable per message deflate");
connectApp->add_flag("-b", binaryMode, "Send in binary mode");
connectApp->add_option("--max_wait", maxWaitBetweenReconnectionRetries, "Max Wait Time between reconnection retries");
CLI::App* chatApp = app.add_subcommand("chat", "Group chat");
chatApp->add_option("url", url, "Connection url")->required();
@ -254,7 +256,8 @@ int main(int argc, char** argv)
else if (app.got_subcommand("connect"))
{
ret = ix::ws_connect_main(url, headers, disableAutomaticReconnection,
disablePerMessageDeflate, binaryMode);
disablePerMessageDeflate, binaryMode,
maxWaitBetweenReconnectionRetries);
}
else if (app.got_subcommand("chat"))
{