Skip to content

Commit 2ea712c

Browse files
vsomeip 3.3.7 (#457)
Notes: - Fix handling of endpoint options - Fix build on Windows - Fix client-side logging filters - Rework in event::set_payload - Release no longer in use client endpoints - Rework condition for starting the send operation - Verify if the event is shadow
1 parent ebb5312 commit 2ea712c

21 files changed

+289
-206
lines changed

Android.bp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ cc_library_shared {
8080

8181
cflags: [
8282
"-DWITHOUT_SYSTEMD",
83-
"-DVSOMEIP_COMPAT_VERSION=\"3.3.6\"",
83+
"-DVSOMEIP_COMPAT_VERSION=\"3.3.7\"",
8484
"-DVSOMEIP_BASE_PATH=\"/vendor/run/someip/\"",
8585
"-DUSE_DLT",
8686
],

Android.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ LOCAL_CFLAGS := \
100100
-frtti \
101101
-fexceptions \
102102
-DWITHOUT_SYSTEMD \
103-
-DVSOMEIP_VERSION=\"3.3.6\" \
103+
-DVSOMEIP_VERSION=\"3.3.7\" \
104104
-DVSOMEIP_BASE_PATH=\"/vendor/run/someip/\" \
105105
-Wno-unused-parameter \
106106
-Wno-non-virtual-dtor \
@@ -147,7 +147,7 @@ LOCAL_CFLAGS := \
147147
-frtti \
148148
-fexceptions \
149149
-DWITHOUT_SYSTEMD \
150-
-DVSOMEIP_VERSION=\"3.3.6\" \
150+
-DVSOMEIP_VERSION=\"3.3.7\" \
151151
-DVSOMEIP_BASE_PATH=\"/vendor/run/someip/\" \
152152
-Wno-unused-parameter \
153153
-Wno-non-virtual-dtor \
@@ -194,8 +194,8 @@ LOCAL_CFLAGS := \
194194
-frtti \
195195
-fexceptions \
196196
-DWITHOUT_SYSTEMD \
197-
-DVSOMEIP_VERSION=\"3.3.6\" \
198-
-DVSOMEIP_COMPAT_VERSION=\"3.3.6\" \
197+
-DVSOMEIP_VERSION=\"3.3.7\" \
198+
-DVSOMEIP_COMPAT_VERSION=\"3.3.7\" \
199199
-DVSOMEIP_BASE_PATH=\"/vendor/run/someip/\" \
200200
-Wno-unused-parameter \
201201
-Wno-non-virtual-dtor \

CHANGES

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
Changes
22
=======
3+
v3.3.7
4+
- Fix handling of endpoint options
5+
- Fix build on Windows
6+
- Fix client-side logging filters
7+
- Rework in event::set_payload
8+
- Release no longer in use client endpoints
9+
- Rework condition for starting the send operation
10+
- Verify if the event is shadow
311

412
v3.3.6
513
- The "last forwarded" timestamp must be handled per event

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set (VSOMEIP_COMPAT_NAME vsomeip)
1111

1212
set (VSOMEIP_MAJOR_VERSION 3)
1313
set (VSOMEIP_MINOR_VERSION 3)
14-
set (VSOMEIP_PATCH_VERSION 6)
14+
set (VSOMEIP_PATCH_VERSION 7)
1515
set (VSOMEIP_HOTFIX_VERSION 0)
1616

1717
set (VSOMEIP_VERSION ${VSOMEIP_MAJOR_VERSION}.${VSOMEIP_MINOR_VERSION}.${VSOMEIP_PATCH_VERSION})
@@ -232,7 +232,7 @@ if (MSVC)
232232
# add_definitions(-DVSOMEIP_DLL_COMPILATION) now it is controlled per target
233233
SET(BOOST_WINDOWS_VERSION "0x600" CACHE STRING "Set the same Version as the Version with which Boost was built, otherwise there will be errors. (normaly 0x600 is for Windows 7 and 0x501 is for Windows XP)")
234234
# Disable warning C4250 since it warns that the compiler is correctly following the C++ Standard. It's a "We-Are-Doing-Things-By-The-Book" notice, not a real warning.
235-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -D_WIN32_WINNT=${BOOST_WINDOWS_VERSION} -DWIN32 -DBOOST_ASIO_DISABLE_IOCP /EHsc /std:c++latest /wd4250")
235+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -D_WIN32_WINNT=${BOOST_WINDOWS_VERSION} -DWIN32 -DBOOST_ASIO_DISABLE_IOCP /EHsc /std:c++14 /wd4250")
236236
set(USE_RT "")
237237
link_directories(${Boost_LIBRARY_DIR_DEBUG})
238238
ADD_DEFINITIONS( -DBOOST_ALL_DYN_LINK )

implementation/endpoints/include/server_endpoint_impl.hpp

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,20 @@ class server_endpoint_impl: public endpoint_impl<Protocol>,
3232
: train_(std::make_shared<train>()),
3333
dispatch_timer_(std::make_shared<boost::asio::steady_timer>(_io)),
3434
has_last_departure_(false),
35-
queue_size_(0) {
35+
queue_size_(0),
36+
is_sending_(false),
37+
sent_timer_(_io),
38+
io_(_io) {
39+
}
40+
41+
endpoint_data_type(const endpoint_data_type &&_source)
42+
: train_(_source.train_),
43+
dispatch_timer_(std::make_shared<boost::asio::steady_timer>(_source.io_)),
44+
has_last_departure_(_source.has_last_departure_),
45+
queue_size_(_source.queue_size_),
46+
is_sending_(_source.is_sending_),
47+
sent_timer_(_source.io_),
48+
io_(_source.io_) {
3649
}
3750

3851
std::shared_ptr<train> train_;
@@ -44,6 +57,11 @@ class server_endpoint_impl: public endpoint_impl<Protocol>,
4457

4558
std::deque<std::pair<message_buffer_ptr_t, uint32_t> > queue_;
4659
std::size_t queue_size_;
60+
61+
bool is_sending_;
62+
boost::asio::steady_timer sent_timer_;
63+
64+
boost::asio::io_context &io_;
4765
};
4866

4967
typedef typename std::map<endpoint_type, endpoint_data_type> target_data_type;
@@ -105,8 +123,7 @@ class server_endpoint_impl: public endpoint_impl<Protocol>,
105123
bool check_queue_limit(const uint8_t *_data, std::uint32_t _size,
106124
std::size_t _current_queue_size) const;
107125
bool queue_train(const target_data_iterator_type _it,
108-
const std::shared_ptr<train> &_train,
109-
bool _queue_size_zero_on_entry);
126+
const std::shared_ptr<train> &_train);
110127

111128
void send_segments(const tp::tp_split_messages_t &_segments,
112129
std::uint32_t _separation_time, const endpoint_type &_target);
@@ -123,10 +140,6 @@ class server_endpoint_impl: public endpoint_impl<Protocol>,
123140

124141
mutable std::mutex mutex_;
125142

126-
std::mutex sent_mutex_;
127-
bool is_sending_;
128-
boost::asio::steady_timer sent_timer_;
129-
130143
private:
131144
virtual std::string get_remote_information(
132145
const target_data_iterator_type _queue_iterator) const = 0;

implementation/endpoints/include/tcp_server_endpoint_impl.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class tcp_server_endpoint_impl: public tcp_server_endpoint_base_impl {
4141
bool send_error(const std::shared_ptr<endpoint_definition> _target,
4242
const byte_t *_data, uint32_t _size);
4343
bool send_queued(const target_data_iterator_type _it);
44-
void send_queued_sync(const target_data_iterator_type _it);
4544
void get_configured_times_from_endpoint(
4645
service_t _service, method_t _method,
4746
std::chrono::nanoseconds *_debouncing,
@@ -83,7 +82,6 @@ class tcp_server_endpoint_impl: public tcp_server_endpoint_base_impl {
8382
void receive();
8483

8584
void send_queued(const target_data_iterator_type _it);
86-
void send_queued_sync(const target_data_iterator_type _it);
8785

8886
void set_remote_info(const endpoint_type &_remote);
8987
std::string get_address_port_remote() const;

implementation/endpoints/src/endpoint_impl.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,18 @@ instance_t endpoint_impl<Protocol>::get_instance(service_t _service) {
145145
}
146146

147147
// Instantiate template
148-
#if defined(__linux__) || defined(ANDROID)
148+
#ifdef __linux__
149149
template class endpoint_impl<boost::asio::local::stream_protocol>;
150150
#if VSOMEIP_BOOST_VERSION < 106600
151151
template class endpoint_impl<boost::asio::local::stream_protocol_ext>;
152-
template class endpoint_impl<boost::asio::ip::udp_ext>;
153152
#endif
154153
#endif
154+
155155
template class endpoint_impl<boost::asio::ip::tcp>;
156156
template class endpoint_impl<boost::asio::ip::udp>;
157157

158+
#if VSOMEIP_BOOST_VERSION < 106600
159+
template class endpoint_impl<boost::asio::ip::udp_ext>;
160+
#endif
161+
158162
} // namespace vsomeip_v3

implementation/endpoints/src/endpoint_manager_impl.cpp

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,14 @@ void
353353
endpoint_manager_impl::clear_client_endpoints(
354354
service_t _service, instance_t _instance, bool _reliable) {
355355

356-
std::shared_ptr<endpoint> endpoint_to_delete;
356+
std::shared_ptr<endpoint> its_endpoint;
357+
358+
boost::asio::ip::address its_remote_address;
359+
port_t its_local_port(0);
360+
port_t its_remote_port(0);
361+
357362
bool other_services_reachable_through_endpoint(false);
363+
358364
{
359365
std::lock_guard<std::recursive_mutex> its_lock(endpoint_mutex_);
360366
// Clear client endpoints for remote services (generic and specific ones)
@@ -365,8 +371,7 @@ endpoint_manager_impl::clear_client_endpoints(
365371
const auto found_reliability = found_instance->second.find(_reliable);
366372
if (found_reliability != found_instance->second.end()) {
367373
service_instances_[_service].erase(found_reliability->second.get());
368-
endpoint_to_delete = found_reliability->second;
369-
374+
its_endpoint = found_reliability->second;
370375
found_instance->second.erase(found_reliability);
371376
if (found_instance->second.empty()) {
372377
found_service->second.erase(found_instance);
@@ -380,12 +385,12 @@ endpoint_manager_impl::clear_client_endpoints(
380385

381386
// Only stop and delete the endpoint if none of the services
382387
// reachable through it is online anymore.
383-
if (endpoint_to_delete) {
388+
if (its_endpoint) {
384389
for (const auto& service : remote_services_) {
385390
for (const auto& instance : service.second) {
386391
const auto found_reliability = instance.second.find(_reliable);
387392
if (found_reliability != instance.second.end()
388-
&& found_reliability->second == endpoint_to_delete) {
393+
&& found_reliability->second == its_endpoint) {
389394
other_services_reachable_through_endpoint = true;
390395
break;
391396
}
@@ -395,35 +400,35 @@ endpoint_manager_impl::clear_client_endpoints(
395400

396401
if (!other_services_reachable_through_endpoint) {
397402
partition_id_t its_partition;
398-
boost::asio::ip::address its_address;
399-
std::uint16_t its_port(0);
400403

401404
its_partition = configuration_->get_partition_id(_service, _instance);
402405

403406
if (_reliable) {
404-
std::shared_ptr<tcp_client_endpoint_impl> ep =
405-
std::dynamic_pointer_cast<tcp_client_endpoint_impl>(endpoint_to_delete);
406-
if (ep) {
407-
its_port = ep->get_remote_port();
408-
ep->get_remote_address(its_address);
407+
std::shared_ptr<tcp_client_endpoint_impl> its_tcp_client_endpoint =
408+
std::dynamic_pointer_cast<tcp_client_endpoint_impl>(its_endpoint);
409+
if (its_tcp_client_endpoint) {
410+
its_local_port = its_tcp_client_endpoint->get_local_port();
411+
its_remote_port = its_tcp_client_endpoint->get_remote_port();
412+
its_tcp_client_endpoint->get_remote_address(its_remote_address);
409413
}
410414
} else {
411-
std::shared_ptr<udp_client_endpoint_impl> ep =
412-
std::dynamic_pointer_cast<udp_client_endpoint_impl>(endpoint_to_delete);
413-
if (ep) {
414-
its_port = ep->get_remote_port();
415-
ep->get_remote_address(its_address);
415+
std::shared_ptr<udp_client_endpoint_impl> its_udp_client_endpoint =
416+
std::dynamic_pointer_cast<udp_client_endpoint_impl>(its_endpoint);
417+
if (its_udp_client_endpoint) {
418+
its_local_port = its_udp_client_endpoint->get_local_port();
419+
its_remote_port = its_udp_client_endpoint->get_remote_port();
420+
its_udp_client_endpoint->get_remote_address(its_remote_address);
416421
}
417422
}
418-
const auto found_ip = client_endpoints_by_ip_.find(its_address);
423+
const auto found_ip = client_endpoints_by_ip_.find(its_remote_address);
419424
if (found_ip != client_endpoints_by_ip_.end()) {
420-
const auto found_port = found_ip->second.find(its_port);
425+
const auto found_port = found_ip->second.find(its_remote_port);
421426
if (found_port != found_ip->second.end()) {
422427
auto found_reliable = found_port->second.find(_reliable);
423428
if (found_reliable != found_port->second.end()) {
424429
const auto found_partition = found_reliable->second.find(its_partition);
425430
if (found_partition != found_reliable->second.end()) {
426-
if (found_partition->second == endpoint_to_delete) {
431+
if (found_partition->second == its_endpoint) {
427432
found_reliable->second.erase(its_partition);
428433
// delete if necessary
429434
if (0 == found_reliable->second.size()) {
@@ -443,8 +448,11 @@ endpoint_manager_impl::clear_client_endpoints(
443448
}
444449
}
445450
}
446-
if (!other_services_reachable_through_endpoint && endpoint_to_delete) {
447-
endpoint_to_delete->stop();
451+
if (!other_services_reachable_through_endpoint && its_endpoint) {
452+
release_used_client_port(its_remote_address, its_remote_port,
453+
_reliable, its_local_port);
454+
455+
its_endpoint->stop();
448456
}
449457
}
450458

0 commit comments

Comments
 (0)