diff --git a/apps/EchoClient.cpp b/apps/EchoClient.cpp index 186d66454fc5b08af5d35604991ca961dd2921bd..e63036772097cf95b8e9eab15c315b6dda233242 100644 --- a/apps/EchoClient.cpp +++ b/apps/EchoClient.cpp @@ -69,6 +69,7 @@ size_t size = SIZE; size_t server_backlog = SERVER_BACKLOG; bool linked_futures; bool histogram = false; +bool sendQuit = true; std::atomic<bool> terminate = false; @@ -226,8 +227,8 @@ class Client { } public: - void shutdown(bool sendQuit) const { - if (sendQuit) { + void shutdown(bool isQuitClient) const { + if (sendQuit && isQuitClient) { LOGI("Send quit message"); std::string msg = "quit\n"; ssize_t res = emper::io::sendAndWait(sock, msg.c_str(), msg.size(), MSG_NOSIGNAL); @@ -438,6 +439,8 @@ auto main(int argc, char* argv[]) -> int { } } + sendQuit = !existsOption(argc, argv, "--no-quit"); + int histogram_fd; char* histogram_file = getOption(argc, argv, "--histogram"); if (histogram_file) {