@@ -82,24 +82,30 @@ struct SocketMapKeyHasher {
8282int SocketMapInsert (const SocketMapKey& key, SocketId* id,
8383 const std::shared_ptr<SocketSSLContext>& ssl_ctx,
8484 bool use_rdma,
85- const HealthCheckOption& hc_option,
86- const butil::EndPoint& client_endpoint,
87- const std::string& device_name);
85+ const HealthCheckOption& hc_option) {
86+ SocketOptions opt;
87+ opt.remote_side = key.peer .addr ;
88+ opt.initial_ssl_ctx = ssl_ctx;
89+ opt.use_rdma = use_rdma;
90+ opt.hc_option = hc_option;
91+ return SocketMapInsert (key, id, opt);
92+ }
8893
8994inline int SocketMapInsert (const SocketMapKey& key, SocketId* id,
9095 const std::shared_ptr<SocketSSLContext>& ssl_ctx) {
9196 HealthCheckOption hc_option;
92- butil::EndPoint endpoint;
93- return SocketMapInsert (key, id, ssl_ctx, false , hc_option, endpoint, " " );
97+ return SocketMapInsert (key, id, ssl_ctx, false , hc_option);
9498}
9599
96100inline int SocketMapInsert (const SocketMapKey& key, SocketId* id) {
97101 std::shared_ptr<SocketSSLContext> empty_ptr;
98102 HealthCheckOption hc_option;
99- butil::EndPoint endpoint;
100- return SocketMapInsert (key, id, empty_ptr, false , hc_option, endpoint, " " );
103+ return SocketMapInsert (key, id, empty_ptr, false , hc_option);
101104}
102105
106+ inline int SocketMapInsert (const SocketMapKey& key, SocketId* id,
107+ SocketOptions& opt);
108+
103109// Find the SocketId associated with `key'.
104110// Return 0 on found, -1 otherwise.
105111int SocketMapFind (const SocketMapKey& key, SocketId* id);
@@ -159,22 +165,26 @@ class SocketMap {
159165 int Insert (const SocketMapKey& key, SocketId* id,
160166 const std::shared_ptr<SocketSSLContext>& ssl_ctx,
161167 bool use_rdma,
162- const HealthCheckOption& hc_option,
163- const butil::EndPoint& client_endpoint,
164- const std::string& device_name);
168+ const HealthCheckOption& hc_option) {
169+ SocketOptions opt;
170+ opt.remote_side = key.peer .addr ;
171+ opt.initial_ssl_ctx = ssl_ctx;
172+ opt.use_rdma = use_rdma;
173+ opt.hc_option = hc_option;
174+ return Insert (key, id, opt);
175+ }
165176
166177 int Insert (const SocketMapKey& key, SocketId* id,
167178 const std::shared_ptr<SocketSSLContext>& ssl_ctx) {
168179 HealthCheckOption hc_option;
169- butil::EndPoint endpoint;
170- return Insert (key, id, ssl_ctx, false , hc_option, endpoint, " " );
180+ return Insert (key, id, ssl_ctx, false , hc_option);
171181 }
172182 int Insert (const SocketMapKey& key, SocketId* id) {
173183 std::shared_ptr<SocketSSLContext> empty_ptr;
174184 HealthCheckOption hc_option;
175- butil::EndPoint endpoint;
176- return Insert (key, id, empty_ptr, false , hc_option, endpoint, " " );
185+ return Insert (key, id, empty_ptr, false , hc_option);
177186 }
187+ int Insert (const SocketMapKey& key, SocketId* id, SocketOptions& opt);
178188
179189 void Remove (const SocketMapKey& key, SocketId expected_id);
180190 int Find (const SocketMapKey& key, SocketId* id);
0 commit comments