MCPcopy Create free account
hub / github.com/COVESA/vsomeip / update

Method update

implementation/endpoints/src/local_socket_tcp_impl.cpp:169–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169bool local_socket_tcp_impl::update(vsomeip_sec_client_t& _client, configuration const& _configuration) {
170 auto address = peer_endpoint_.address();
171 auto port = peer_endpoint_.port();
172
173 if (address.is_v4()) {
174 _client.host = htonl(uint32_t(address.to_v4().to_uint()));
175 }
176 if (role_ == socket_role_e::CLIENT) {
177 // temporary hack, because this used to be called only for incoming (not outgoing!)
178 // tcp connections, and security lib does not have configuration for _some_ outgoing
179 // connections
180 port += 1;
181 }
182 _client.port = htons(port);
183
184 _configuration.get_security()->sync_client(&_client);
185 return true;
186}
187port_t local_socket_tcp_impl::own_port() const {
188 return own_endpoint_.port();
189}

Callers

nothing calls this directly

Calls 2

is_v4Method · 0.80
get_securityMethod · 0.80

Tested by

no test coverage detected