VSomeIP 在 Windows 平台使用【遇到 SD 问题及解决过程记录】
【生活经历分享】华师国培 华师伴学 合同都是坑 消费者付款后无法退款和华师国培签合同需小心,合同中都是保护华师的条款,没有保护消费者的条款。
收到钱,就算你因对培训质量不满意,也不能退款。因合同消费者维权肯定十分艰难。
华师伴学的授课方式是看录制的视频,不是真人现场教学。是否是您和孩子想要的学习方式?
各位打算报名的,交费要谨慎!
其他人在小红书上发的,转:
深圳市华师国培教育科技有限公司,黑心机构,大家擦亮眼睛,别被骗了,消费欺诈,虚假承诺,签合同各种坑,收到钱了不履行承诺不退款,乱扣费,维权艰难! - 小红书
【说明:欢迎转载!转载请注明出处,且不能修改文章内容。否则,请勿转载!】
在 Windows 平台使用 VSomeIP 3.5.x 实现 someip 功能时,发现 Offer 功能有问题,即 Offer 数据包在调用 offer_service 后在 Wireshark 中没有相应的网络包。
使用测试工具:PacketSender 在 Windows 平台测试发现多播数据包发送是正常的。
所以初步怀疑是 VSomeIP 在 windows 平台下存在 Bug.
在 VSomeIP 的源代码中增加 Log 分析,最后怀疑是变量 sd_route_set_ 的赋值有问题,Log 如下:
2025-11-03 10:16:44.128667 [info] Using configuration file: "E:\vsomeip_VS2019\vsomeip-3.5.6\vs2019_prj\examples\vsomeip.json".
2025-11-03 10:16:44.130722 [info] Parsed vsomeip configuration in 23ms
2025-11-03 10:16:44.132601 [info] Security disabled!
2025-11-03 10:16:44.133940 [info] Initializing vsomeip (3.5.6) application "someip_hs_server".
2025-11-03 10:16:44.135476 [error] vsomeip_v3::utility::is_routing_manager - file: \vsomeip.lck Create failed: 50
2025-11-03 10:16:44.136890 [error] vsomeip_v3::utility::is_routing_manager - file: E:\vsomeip_VS2019\vsomeip-3.5.6\vs2019_prj\examples\vsomeip.lck Create failed: 50
2025-11-03 10:16:44.138414 [info] Instantiating routing manager [Host].
2025-11-03 10:16:44.139991 [info] vsomeip_v3::endpoint_manager_impl::endpoint_manager_impl: Connecting to other clients from 127.0.0.1:31491
2025-11-03 10:16:44.141074 [info] is_external_routing_ready if_state_running_: [0]
2025-11-03 10:16:44.142751 [info] vsomeip_v3::endpoint_manager_impl::create_routing_root: Routing root @ 127.0.0.1:31490
2025-11-03 10:16:44.143752 [info] is_external_routing_ready !is_sd_enabled: [0]
2025-11-03 10:16:44.150549 [info] is_external_routing_ready is_sd_enabled: [1]
2025-11-03 10:16:44.154944 [info] is_external_routing_ready sd_route_set_: [0]
2025-11-03 10:16:44.165025 [info] is_external_routing_ready ret_val: [0]
2025-11-03 10:16:44.167388 [info] Service Discovery enabled. Trying to load module.
2025-11-03 10:16:44.167890 [info] process_multicast_options: [1]
2025-11-03 10:16:44.490169 [info] Service Discovery module loaded.
2025-11-03 10:16:44.492010 [info] is_external_routing_ready if_state_running_: [0]
2025-11-03 10:16:44.499004 [info] is_external_routing_ready !is_sd_enabled: [0]
2025-11-03 10:16:44.499219 [info] Application(someip_hs_server, 1618) is initialized (11, 100).
2025-11-03 10:16:44.500159 [info] [<<server>>]Static routing OFF
[<<server>>]Static routing, use UDP
is_external_routing_ready is_sd_enabled: [1]
2025-11-03 10:16:44.502675 [debug] rmi::vsomeip_v3::routing_manager_impl::offer_service call insert_offer_command end. client: 5656
2025-11-03 10:16:44.502710 [info] is_external_routing_ready sd_route_set_: [0]
2025-11-03 10:16:44.503849 [debug] rmi::vsomeip_v3::routing_manager_impl::offer_service call configuration_->get_security end. client: 5656
2025-11-03 10:16:44.504969 [info] is_external_routing_ready ret_val: [0]
2025-11-03 10:16:44.506728 [debug] rmi::vsomeip_v3::routing_manager_impl::offer_service call handle_local_offer_service end. client: 5656
2025-11-03 10:16:44.507788 [info] process_multicast_options options_queue_.size: [0]
2025-11-03 10:16:44.509009 [info] is_external_routing_ready if_state_running_: [0]
2025-11-03 10:16:44.510136 [info] process_multicast_options is_external_routing_ready: [0]
2025-11-03 10:16:44.511271 [info] is_external_routing_ready !is_sd_enabled: [0]
2025-11-03 10:16:44.513536 [info] is_external_routing_ready is_sd_enabled: [1]
2025-11-03 10:16:44.514662 [info] is_external_routing_ready sd_route_set_: [0]
2025-11-03 10:16:44.516304 [info] is_external_routing_ready ret_val: [0]
2025-11-03 10:16:44.517500 [info] rmi::vsomeip_v3::routing_manager_impl::offer_service added service: 7363 to pending_sd_offers_.size = 1
2025-11-03 10:16:44.518765 [debug] rmi::vsomeip_v3::routing_manager_impl::offer_service call find_service end. service: 29539its_info: not empty
2025-11-03 10:16:44.519943 [debug] rmi::vsomeip_v3::sd::service_discovery_impl::offer_service enter service_discovery_impl::offer_service. service: 7363 found: 0
2025-11-03 10:16:44.521261 [debug] vsomeip_v3::routing_manager_stub::on_offer_service offer event(client:1618): [7363.0001- SomeIP Ver:1.0]
2025-11-03 10:16:44.522729 [info] vsomeip_v3::endpoint_manager_base::create_local_server: Listening @ 127.0.0.1:31492
2025-11-03 10:16:44.523880 [info] vsomeip_v3::endpoint_manager_base::create_local_server: Connecting to other clients from 127.0.0.1:31491
2025-11-03 10:16:44.527381 [debug] rmi::vsomeip_v3::routing_manager_impl::offer_service call on_offer_service end. client: 5656 service: 29539
2025-11-03 10:16:44.528681 [info] vsomeip_v3::routing_manager_impl::offer_service OFFER(1618): [7363.0001:1.0] (true)
2025-11-03 10:16:44.529927 [debug] rmi::vsomeip_v3::routing_manager_impl::offer_service call insert_offer_command end. client: 5656
2025-11-03 10:16:44.531213 [debug] rmi::vsomeip_v3::routing_manager_impl::offer_service call configuration_->get_security end. client: 5656
2025-11-03 10:16:44.533044 [debug] rmi::vsomeip_v3::routing_manager_impl::offer_service call handle_local_offer_service end. client: 5656
2025-11-03 10:16:44.535859 [info] is_external_routing_ready if_state_running_: [0]
2025-11-03 10:16:44.542403 [info] is_external_routing_ready !is_sd_enabled: [0]
再使用此变量和其它关键字在网上查询,在 VSomeIP GitHub 网站上找到类似的 Bug 反馈。

遗憾的是此修改还未被官方导入的最新 Release 版本。
将之前分析 sd_route_set_ 的 Log 删除,按 Github 上的修改代码,虽然可以看到加入多播的过程,但是仍然没有 Offer 数据包在 Wireshark 中出现。
Log:
2025-11-03 10:34:58.661087 [info] Using configuration file: "H:\openSource\COVESA-VSomeIP\vsomeip_src_GitHub\vs2019_prj\examples\vsomeip.json". 2025-11-03 10:34:58.665756 [info] Parsed vsomeip configuration in 83ms 2025-11-03 10:34:58.666181 [info] Configuration loaded with Multiple Routing Managers ENABLED. 2025-11-03 10:34:58.666503 [info] Security disabled! 2025-11-03 10:34:58.666620 [info] Initializing vsomeip (3.5.9) application "someip_hs_server". 2025-11-03 10:34:58.666967 [debug] vsomeip_v3::utility::is_routing_manager: Removing stale lock file (PID 13244 no longer exists) 2025-11-03 10:34:58.667503 [info] Instantiating routing manager [Host]. 2025-11-03 10:34:58.668031 [info] vsomeip_v3::endpoint_manager_impl::endpoint_manager_impl: Connecting to other clients from 127.0.0.1:31491 2025-11-03 10:34:58.670003 [info] vsomeip_v3::endpoint_manager_impl::create_routing_root: Routing root @ 127.0.0.1:314902025-11-03 10:34:58.741437 [info] Service Discovery enabled. Trying to load module. 2025-11-03 10:34:58.753506 [info] Service Discovery module loaded. 2025-11-03 10:34:58.763822 [info] Application(someip_hs_server, 1618) is initialized (11, 100). 2025-11-03 10:34:58.764185 [info] vsomeip_v3::application_impl::offer_event: Event [1234.5678.8778] uses configured cycle time 0ms 2025-11-03 10:34:58.764586 [info] REGISTER EVENT(1618): [1234.5678.8778:is_provider=true] [run]Application someip_hs_serveris_registered_ is 0 2025-11-03 10:34:58.764813 [info] Starting vsomeip application "someip_hs_server" (1618) using 2 threads boost event loop period 0 2025-11-03 10:34:58.765141 [debug] Thread created. Number of active threads for someip_hs_server : 1 2025-11-03 10:34:58.765483 [info] usei#1::constructor 2025-11-03 10:34:58.765598 [info] usei#1::init: 172.20.3.2:30490, lifecycle_idx=0 2025-11-03 10:34:58.765893 [info] usei#1::172.20.3.2:30490::init: lifecycle_idx=0, 操作成功完成。 2025-11-03 10:34:58.766360 [info] usei#1::172.20.3.2:30490::start, lifecycle_idx=0 2025-11-03 10:34:58.766459 [info] usei#1::172.20.3.2:30490::start_unlocked: start unicast data handler, lifecycle_idx=1 2025-11-03 10:34:58.766648 [info] usei#1::172.20.3.2:30490::start_unlocked: join 0 groups 2025-11-03 10:34:58.766769 [info] usei#1::172.20.3.2:30490::start: done, lifecycle_idx=1 2025-11-03 10:34:58.766938 [info] usei#1::172.20.3.2:30490::join: 239.255.3.1 2025-11-03 10:34:58.767108 [info] usei#1::172.20.3.2:30490::set_multicast_option: join 239.255.3.1, lifecycle_idx=1, stopped=0 2025-11-03 10:34:58.767248 [info] SOME/IP routing ready. 2025-11-03 10:34:58.772919 [info] usei#1::172.20.3.2:30490::set_multicast_option: start multicast data handler, lifecycle_idx=1 2025-11-03 10:34:58.772975 [info] Watchdog is disabled! 2025-11-03 10:34:58.773084 [info] main dispatch thread id from application: 1618 (someip_hs_server) is: 6170 2025-11-03 10:34:58.773442 [info] shutdown thread id from application: 1618 (someip_hs_server) is: 58ec 2025-11-03 10:34:58.775192 [info] [application_impl::start]io thread id from application: 1618 (someip_hs_server) is: 3afc [on_state]Application someip_hs_server is registered. 2025-11-03 10:34:58.777231 [info] vSomeIP 3.5.9 | (default) 2025-11-03 10:34:58.778043 [info] [application_impl::start for]io thread id from application: 1618 (someip_hs_server) is: 33d8 2025-11-03 10:34:58.786906 [info] usei#1::172.20.3.2:30490::set_multicast_option: join successful [on_state] > > > > > > > > > > > > >call start_offer 2025-11-03 10:34:58.883875 [info] Port configuration missing for [1234.5678]. Service is internal. 2025-11-03 10:34:58.890933 [debug] ON_OFFER_SERVICE(1618): [1234.5678:1.0] 2025-11-03 10:35:02.497411 [info] vsomeip_v3::endpoint_manager_base::create_local_server: Listening @ 127.0.0.1:31492 2025-11-03 10:35:02.497658 [warning] Didn't receive a multicast SD message for 2200ms. 2025-11-03 10:35:06.075420 [info] vsomeip_v3::endpoint_manager_base::create_local_server: Connecting to other clients from 127.0.0.1:31491 2025-11-03 10:35:06.077185 [info] <offer_service>OFFER(1618): [1234.5678:1.0] (true) 2025-11-03 10:35:06.075461 [info] usei#1::172.20.3.2:30490::leave: 239.255.3.1 Setting event (Length=1). 2025-11-03 10:35:06.084439 [info] usei#1::172.20.3.2:30490::join: 239.255.3.1 2025-11-03 10:35:06.084606 [info] usei#1::172.20.3.2:30490::set_multicast_option: leave 239.255.3.1, lifecycle_idx=1, stopped=0 2025-11-03 10:35:06.091229 [info] usei#1::172.20.3.2:30490::set_multicast_option: leave successful 2025-11-03 10:35:06.094566 [info] usei#1::172.20.3.2:30490::set_multicast_option: join 239.255.3.1, lifecycle_idx=1, stopped=0 2025-11-03 10:35:06.095589 [info] usei#1::172.20.3.2:30490::set_multicast_option: join successful Setting event (Length=2). Setting event (Length=3).
Wireshark 中如下的加入和退出多播的数据包:

目前使用 VSomeIP 在 windows 平台发送 SD 还未成功,待进一步分析......
问题解决,以上其实已经完成了 VSomeIP 库 Bug 的修改,至于还未成功,是因为测试代码中 SAMPLE_SERVICE_ID 和 SAMPLE_INSTANCE_ID 的定义与 vsomeip.json 中定义的不致引起的。
修改 SAMPLE_SERVICE_ID 和 SAMPLE_INSTANCE_ID 的定义与 vsomeip.json 中定义的一致后,可以看到 Wireshark 中 Join group 后有 Offer 数据包发出。


浙公网安备 33010602011771号