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

Function main

example/rdma_performance/server.cpp:65–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65int main(int argc, char* argv[]) {
66 GFLAGS_NAMESPACE::ParseCommandLineFlags(&argc, &argv, true);
67
68 brpc::Server server;
69 test::PerfTestServiceImpl perf_test_service_impl;
70
71 if (server.AddService(&perf_test_service_impl,
72 brpc::SERVER_DOESNT_OWN_SERVICE) != 0) {
73 LOG(ERROR) << "Fail to add service";
74 return -1;
75 }
76 g_last_time.store(0, butil::memory_order_relaxed);
77
78 brpc::ServerOptions options;
79 options.socket_mode = FLAGS_use_rdma? brpc::SOCKET_MODE_RDMA : brpc::SOCKET_MODE_TCP;
80 if (server.Start(FLAGS_port, &options) != 0) {
81 LOG(ERROR) << "Fail to start EchoServer";
82 return -1;
83 }
84
85 server.RunUntilAskedToQuit();
86 return 0;
87}
88
89#else
90

Callers

nothing calls this directly

Calls 4

AddServiceMethod · 0.80
RunUntilAskedToQuitMethod · 0.80
storeMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected