MCPcopy Create free account
hub / github.com/apache/brpc / main

Function main

tools/rpc_view/rpc_view.cpp:155–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153};
154
155int main(int argc, char* argv[]) {
156 GFLAGS_NAMESPACE::ParseCommandLineFlags(&argc, &argv, true);
157 if (FLAGS_target.empty() &&
158 (argc != 2 ||
159 GFLAGS_NAMESPACE::SetCommandLineOption("target", argv[1]).empty())) {
160 LOG(ERROR) << "Usage: ./rpc_view <ip>:<port>";
161 return -1;
162 }
163 // This keeps ad-hoc creation of channels reuse previous connections.
164 GFLAGS_NAMESPACE::SetCommandLineOption("defer_close_second", "10");
165
166 brpc::Server server;
167 server.set_version("rpc_view_server");
168 brpc::ServerOptions server_opt;
169 server_opt.http_master_service = new ViewServiceImpl;
170 if (server.Start(FLAGS_port, &server_opt) != 0) {
171 LOG(ERROR) << "Fail to start ViewServer";
172 return -1;
173 }
174 server.RunUntilAskedToQuit();
175 return 0;
176}

Callers

nothing calls this directly

Calls 4

RunUntilAskedToQuitMethod · 0.80
emptyMethod · 0.45
set_versionMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected