| 73 | }; |
| 74 | |
| 75 | static 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 | |
| 89 | SocketMap* get_client_side_socket_map() { |
| 90 | // The consume fence makes sure that we see a NULL or a fully initialized |