Skip to content

Commit

Permalink
delete deprecated logoff_ms gflag in example folder (#2064)
Browse files Browse the repository at this point in the history
  • Loading branch information
leaf-potato authored Dec 27, 2022
1 parent 3b9fe0a commit 6ebe2e9
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 46 deletions.
2 changes: 0 additions & 2 deletions example/asynchronous_echo_c++/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ DEFINE_bool(send_attachment, true, "Carry attachment along with response");
DEFINE_int32(port, 8003, "TCP Port of this server");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");

// Your implementation of example::EchoService
class EchoServiceImpl : public example::EchoService {
Expand Down
2 changes: 0 additions & 2 deletions example/auto_concurrency_limiter/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
#include <fstream>
#include "cl_test.pb.h"

DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");
DEFINE_int32(server_bthread_concurrency, 4,
"Configuring the value of bthread_concurrency, For compute max qps, ");
DEFINE_int32(server_sync_sleep_us, 2500,
Expand Down
2 changes: 0 additions & 2 deletions example/backup_request_c++/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ DEFINE_bool(echo_attachment, true, "Echo attachment as well");
DEFINE_int32(port, 8000, "TCP Port of this server");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");
DEFINE_int32(sleep_ms, 20, "Sleep so many milliseconds on even-th requests");

// Your implementation of example::EchoService
Expand Down
2 changes: 0 additions & 2 deletions example/cancel_c++/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ DEFINE_bool(echo_attachment, true, "Echo attachment as well");
DEFINE_int32(port, 8000, "TCP Port of this server");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");

// Your implementation of example::EchoService
// Notice that implementing brpc::Describable grants the ability to put
Expand Down
8 changes: 2 additions & 6 deletions example/dynamic_partition_echo_c++/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ DEFINE_bool(echo_attachment, true, "Echo attachment as well");
DEFINE_int32(port, 8004, "TCP Port of this server");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");
DEFINE_int32(max_concurrency, 0, "Limit of request processing in parallel");
DEFINE_int32(server_num, 1, "Number of servers");
DEFINE_string(sleep_us, "", "Sleep so many microseconds before responding");
Expand Down Expand Up @@ -162,11 +160,9 @@ int main(int argc, char* argv[]) {
}

// Don't forget to stop and join the server otherwise still-running
// worker threads may crash your program. Clients will have/ at most
// `FLAGS_logoff_ms' to close their connections. If some connections
// still remains after `FLAGS_logoff_ms', they will be closed by force.
// worker threads may crash your program.
for (int i = 0; i < FLAGS_server_num; ++i) {
servers[i].Stop(FLAGS_logoff_ms);
servers[i].Stop(0/*not used now*/);
}
for (int i = 0; i < FLAGS_server_num; ++i) {
servers[i].Join();
Expand Down
2 changes: 0 additions & 2 deletions example/echo_c++/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ DEFINE_string(listen_addr, "", "Server listen address, may be IPV4/IPV6/UDS."
" If this is set, the flag port will be ignored");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");

// Your implementation of example::EchoService
// Notice that implementing brpc::Describable grants the ability to put
Expand Down
2 changes: 0 additions & 2 deletions example/grpc_c++/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
DEFINE_int32(port, 50051, "TCP Port of this server");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");
DEFINE_bool(gzip, false, "compress body using gzip");

class GreeterImpl : public helloworld::Greeter {
Expand Down
2 changes: 0 additions & 2 deletions example/http_c++/http_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
DEFINE_int32(port, 8010, "TCP Port of this server");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");

DEFINE_string(certificate, "cert.pem", "Certificate file path to enable SSL");
DEFINE_string(private_key, "key.pem", "Private key file path to enable SSL");
Expand Down
2 changes: 0 additions & 2 deletions example/multi_threaded_echo_c++/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ DEFINE_bool(echo_attachment, true, "Echo attachment as well");
DEFINE_int32(port, 8002, "TCP Port of this server");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");
DEFINE_int32(max_concurrency, 0, "Limit of request processing in parallel");
DEFINE_int32(internal_port, -1, "Only allow builtin services at this port");

Expand Down
8 changes: 2 additions & 6 deletions example/multi_threaded_echo_fns_c++/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ DEFINE_bool(send_attachment, false, "Carry attachment along with response");
DEFINE_int32(port, 8004, "TCP Port of this server");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");
DEFINE_int32(max_concurrency, 0, "Limit of request processing in parallel");
DEFINE_int32(server_num, 1, "Number of servers");
DEFINE_string(sleep_us, "", "Sleep so many microseconds before responding");
Expand Down Expand Up @@ -177,11 +175,9 @@ int main(int argc, char* argv[]) {
}

// Don't forget to stop and join the server otherwise still-running
// worker threads may crash your program. Clients will have/ at most
// `FLAGS_logoff_ms' to close their connections. If some connections
// still remains after `FLAGS_logoff_ms', they will be closed by force.
// worker threads may crash your program.
for (int i = 0; i < FLAGS_server_num; ++i) {
servers[i].Stop(FLAGS_logoff_ms);
servers[i].Stop(0/*not used now*/);
}
for (int i = 0; i < FLAGS_server_num; ++i) {
servers[i].Join();
Expand Down
2 changes: 0 additions & 2 deletions example/parallel_echo_c++/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ DEFINE_bool(echo_attachment, true, "Echo attachment as well");
DEFINE_int32(port, 8002, "TCP Port of this server");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");
DEFINE_int32(max_concurrency, 0, "Limit of request processing in parallel");

// Your implementation of example::EchoService
Expand Down
8 changes: 2 additions & 6 deletions example/partition_echo_c++/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ DEFINE_bool(echo_attachment, true, "Echo attachment as well");
DEFINE_int32(port, 8002, "TCP Port of this server");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");
DEFINE_int32(max_concurrency, 0, "Limit of request processing in parallel");
DEFINE_int32(server_num, 1, "Number of servers");
DEFINE_string(sleep_us, "", "Sleep so many microseconds before responding");
Expand Down Expand Up @@ -162,11 +160,9 @@ int main(int argc, char* argv[]) {
}

// Don't forget to stop and join the server otherwise still-running
// worker threads may crash your program. Clients will have/ at most
// `FLAGS_logoff_ms' to close their connections. If some connections
// still remains after `FLAGS_logoff_ms', they will be closed by force.
// worker threads may crash your program.
for (int i = 0; i < FLAGS_server_num; ++i) {
servers[i].Stop(FLAGS_logoff_ms);
servers[i].Stop(0/*not used now*/);
}
for (int i = 0; i < FLAGS_server_num; ++i) {
servers[i].Join();
Expand Down
8 changes: 2 additions & 6 deletions example/selective_echo_c++/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ DEFINE_bool(echo_attachment, true, "Echo attachment as well");
DEFINE_int32(port, 8114, "TCP Port of this server");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");
DEFINE_int32(max_concurrency, 0, "Limit of request processing in parallel");
DEFINE_int32(server_num, 7, "Number of servers");
DEFINE_string(sleep_us, "", "Sleep so many microseconds before responding");
Expand Down Expand Up @@ -161,11 +159,9 @@ int main(int argc, char* argv[]) {
}

// Don't forget to stop and join the server otherwise still-running
// worker threads may crash your program. Clients will have/ at most
// `FLAGS_logoff_ms' to close their connections. If some connections
// still remains after `FLAGS_logoff_ms', they will be closed by force.
// worker threads may crash your program.
for (int i = 0; i < FLAGS_server_num; ++i) {
servers[i].Stop(FLAGS_logoff_ms);
servers[i].Stop(0/*not used now*/);
}
for (int i = 0; i < FLAGS_server_num; ++i) {
servers[i].Join();
Expand Down
2 changes: 0 additions & 2 deletions example/session_data_and_thread_local/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ DEFINE_bool(echo_attachment, true, "Echo attachment as well");
DEFINE_int32(port, 8002, "TCP Port of this server");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");
DEFINE_int32(max_concurrency, 0, "Limit of request processing in parallel");

butil::atomic<int> nsd(0);
Expand Down
2 changes: 0 additions & 2 deletions example/streaming_echo_c++/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ DEFINE_bool(send_attachment, true, "Carry attachment along with response");
DEFINE_int32(port, 8001, "TCP Port of this server");
DEFINE_int32(idle_timeout_s, -1, "Connection will be closed if there is no "
"read/write operations during the last `idle_timeout_s'");
DEFINE_int32(logoff_ms, 2000, "Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)");

class StreamReceiver : public brpc::StreamInputHandler {
public:
Expand Down

0 comments on commit 6ebe2e9

Please sign in to comment.