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

Function CreateClientSideSocketMap

src/brpc/socket_map.cpp:75–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73};
74
75static void CreateClientSideSocketMap() {
76 SocketMap* socket_map = new SocketMap;
77 SocketMapOptions options;
78 options.socket_creator = new GlobalSocketCreator;
79 options.idle_timeout_second_dynamic = &FLAGS_idle_timeout_second;
80 options.defer_close_second_dynamic = &FLAGS_defer_close_second;
81 options.defer_close_respect_idle_dynamic = &FLAGS_defer_close_respect_idle;
82 if (socket_map->Init(options) != 0) {
83 LOG(FATAL) << "Fail to init SocketMap";
84 exit(1);
85 }
86 g_socket_map.store(socket_map, butil::memory_order_release);
87}
88
89SocketMap* get_client_side_socket_map() {
90 // The consume fence makes sure that we see a NULL or a fully initialized

Callers

nothing calls this directly

Calls 2

InitMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected