@@ -80,24 +80,30 @@ struct SocketMapKeyHasher {
8080// successfully, SocketMapRemove() MUST be called when the Socket is not needed.
8181// Return 0 on success, -1 otherwise.
8282int SocketMapInsert (const SocketMapKey& key, SocketId* id,
83+ SocketOptions& opt);
84+
85+ inline int SocketMapInsert (const SocketMapKey& key, SocketId* id,
8386 const std::shared_ptr<SocketSSLContext>& ssl_ctx,
8487 bool use_rdma,
85- const HealthCheckOption& hc_option,
86- const butil::EndPoint& client_endpoint,
87- const std::string& device_name);
88+ const HealthCheckOption& hc_option) {
89+ SocketOptions opt;
90+ opt.remote_side = key.peer .addr ;
91+ opt.initial_ssl_ctx = ssl_ctx;
92+ opt.use_rdma = use_rdma;
93+ opt.hc_option = hc_option;
94+ return SocketMapInsert (key, id, opt);
95+ }
8896
8997inline int SocketMapInsert (const SocketMapKey& key, SocketId* id,
9098 const std::shared_ptr<SocketSSLContext>& ssl_ctx) {
9199 HealthCheckOption hc_option;
92- butil::EndPoint endpoint;
93- return SocketMapInsert (key, id, ssl_ctx, false , hc_option, endpoint, " " );
100+ return SocketMapInsert (key, id, ssl_ctx, false , hc_option);
94101}
95102
96103inline int SocketMapInsert (const SocketMapKey& key, SocketId* id) {
97104 std::shared_ptr<SocketSSLContext> empty_ptr;
98105 HealthCheckOption hc_option;
99- butil::EndPoint endpoint;
100- return SocketMapInsert (key, id, empty_ptr, false , hc_option, endpoint, " " );
106+ return SocketMapInsert (key, id, empty_ptr, false , hc_option);
101107}
102108
103109// Find the SocketId associated with `key'.
@@ -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