Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
3e54138
Add socom as SOME/IP abstraction
lurtz Jan 23, 2026
fc0376c
Use score::result::ErrorCode and MakeUnexpected
lurtz Jan 26, 2026
8c21e9e
remove result.hpp
lurtz Jan 26, 2026
5676025
remove Result aliases
lurtz Jan 26, 2026
71dc2b1
Client_connector::Event struct for bunding API
lurtz Jan 26, 2026
ad77a62
Client_connector event API similar to GenericSkeleton
lurtz Jan 26, 2026
b32c677
Client_connector method API similar to GenericSkeleton
lurtz Jan 26, 2026
d76ddbd
Server_connector event API similar to GenericSkeleton
lurtz Jan 26, 2026
a34dc64
use function to allocate method reply payload
lurtz Jan 26, 2026
b1292c0
fix state transition trigger
lurtz Feb 3, 2026
518ccdf
add comment to optional state
lurtz Feb 3, 2026
284a5cc
Revert "use function to allocate method reply payload"
lurtz Feb 3, 2026
60fad1f
Revert "Server_connector event API similar to GenericSkeleton"
lurtz Feb 3, 2026
e1d8bfc
Revert "Client_connector method API similar to GenericSkeleton"
lurtz Feb 3, 2026
6f5875b
Revert "Client_connector event API similar to GenericSkeleton"
lurtz Feb 3, 2026
d9e8141
Revert "Client_connector::Event struct for bunding API"
lurtz Feb 3, 2026
701ebda
provide reply allocator at method invocation
lurtz Feb 3, 2026
3573800
remove 1:n support
lurtz Feb 3, 2026
e0d9677
Remove event subscription acknowledgement
lurtz Feb 4, 2026
5d8e581
remove multi client support from sequence diagrams and documents
lurtz Feb 4, 2026
49d4796
fix copyright header
lurtz Feb 5, 2026
bb8c3a7
Add original socom tests and fix found issues (#1)
lurtz Feb 10, 2026
f3c7405
Merge remote-tracking branch 'origin/main' into add-socom-as-someip-a…
lurtz Feb 10, 2026
1d1ec03
remove outdated todos
lurtz Feb 10, 2026
f788469
Test event payload allocation
lurtz Feb 10, 2026
109beb5
test method event payload allocation
lurtz Feb 10, 2026
703074a
better documentation, no default construction of callbacks
lurtz Feb 10, 2026
3280d28
provide reply payload together with reply callback
lurtz Feb 10, 2026
aa2a146
test reply payload transmission
lurtz Feb 10, 2026
a182d68
improved payload allocation tests
lurtz Feb 11, 2026
ac18211
Suppress thread sanitizer false positives
lurtz Feb 11, 2026
35d2596
fix undefined behavior sanitizer finding
lurtz Feb 11, 2026
981e95b
test subscribe_find_service with vector callback
lurtz Feb 11, 2026
e9a3316
migrate from ac to score::socom namespace
lurtz Feb 11, 2026
ef5f1a5
move test code into score::socom namespace
lurtz Feb 11, 2026
75160f2
more cleanup
lurtz Feb 11, 2026
e6f7f00
clean up test framework from namespace resolution
lurtz Feb 11, 2026
59f81da
small cleanup for consistency
lurtz Feb 11, 2026
7bf2202
Merge branch 'main' into add-socom-as-someip-abstraction
lurtz Feb 16, 2026
a118199
Merge branch 'main' into add-socom-as-someip-abstraction
lurtz Feb 16, 2026
f3ad2f4
Merge branch 'main' into add-socom-as-someip-abstraction
lurtz Feb 17, 2026
ee272df
fix aarch64 compile errors
lurtz Feb 17, 2026
c2eaf64
fix aarch64 compiler warnings
lurtz Feb 17, 2026
1862c75
Merge branch 'main' into add-socom-as-someip-abstraction
lurtz Mar 9, 2026
692bf0b
Merge branch 'main' into add-socom-as-someip-abstraction
lurtz Mar 23, 2026
af301aa
Make devcontainer work in environment without any QNX setup
lurtz Mar 23, 2026
1ecab42
optional bazel user configuration
lurtz Mar 23, 2026
6423424
Create external symlink based on basename
lurtz Mar 23, 2026
9387ecf
remove sanitizer settings
lurtz Mar 23, 2026
6872456
only create external if it does not exist
lurtz Mar 23, 2026
b60ef13
deprecate Runtime::subscribe_find_service()
lurtz Mar 23, 2026
a6f96a5
Merge remote-tracking branch 'origin/main' into add-socom-as-someip-a…
lurtz Mar 23, 2026
2b2f4ee
Merge remote-tracking branch 'origin/main' into add-socom-as-someip-a…
lurtz Mar 23, 2026
5491c2f
tighter visibility settings
lurtz Mar 23, 2026
997541c
Rename allocate_method_payload() to allocate_method_call_payload()
lurtz Mar 23, 2026
a9a7e96
make Final_action private class
lurtz Mar 23, 2026
a4ef7ae
make sure Final_action really destroys the callable in execute()
lurtz Mar 23, 2026
cd20996
remove Server_service_interface_configuration::invalid()
lurtz Mar 23, 2026
23531a7
In sequence diagrams
lurtz Mar 23, 2026
2105c3f
move to_num_of_{events, methods}() casts to header
lurtz Mar 23, 2026
a9a2241
Rename Service_identifier to Service_instance_identifier
lurtz Mar 23, 2026
ef19651
Require that same interfaces have the same number of methods and events
lurtz Mar 23, 2026
b9abf5a
take interface and instance by value to make ownership clear
lurtz Mar 23, 2026
a3d63e1
Rename Service types
lurtz Mar 23, 2026
cd7f41b
Remove is_only_minor_version_incompatible check
lurtz Mar 24, 2026
9d31e53
fix typos in subscribe_find_service() description
lurtz Mar 24, 2026
bf7833b
consistent subscribe_find_service behavior with no callback given
lurtz Mar 24, 2026
f362f16
clarify meaning of assertion
lurtz Mar 24, 2026
b8da04f
Rename callback to subscription_it
lurtz Mar 24, 2026
4d3d904
remove unused variable
lurtz Mar 24, 2026
0359ef0
doygen for cleanup functions
lurtz Mar 24, 2026
320ac1f
switch to unordered_map for faster access times
lurtz Mar 24, 2026
84ef438
remove copy
lurtz Mar 24, 2026
9685e6c
add missing copyright and license information
lurtz Mar 24, 2026
44bc812
Merge remote-tracking branch 'origin/main' into add-socom-as-someip-a…
lurtz Mar 24, 2026
7ad2f9a
Add string registry
lurtz Mar 25, 2026
747177c
Use string registry for instance and identifier ids
lurtz Mar 25, 2026
6026d25
better comments for constructors of service_instance
lurtz Mar 25, 2026
117f768
update score tooling to fix failed copyright checks
lurtz Mar 25, 2026
ca35e52
Use move_only_function in FInal_action
lurtz Mar 25, 2026
7f10265
Merge remote-tracking branch 'origin/main' into add-socom-as-someip-a…
lurtz Mar 27, 2026
1720454
Merge branch 'main' into add-socom-as-someip-abstraction
lurtz Mar 30, 2026
f724af8
Add Move_only_function_mock
lurtz Mar 30, 2026
cd50ea6
convert client_connector callbacks to move_only_function
lurtz Mar 30, 2026
fcb25f7
convert server_connector callbacks to move_only_function
lurtz Mar 30, 2026
e2f7264
convert Method_reply_callback to move_only_function
lurtz Mar 31, 2026
7d68156
Convert on_deadlock_destruction_callback to move_only_function
lurtz Mar 31, 2026
bbf96ae
Merge branch 'main' into add-socom-as-someip-abstraction
lurtz Mar 31, 2026
488990e
move create_runtime() into separate file
lurtz Mar 31, 2026
6f8fb67
Merge branch 'main' into add-socom-as-someip-abstraction
lurtz Apr 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- id: check-executables-have-shebangs
- id: check-added-large-files
args: [--maxkb=50, --enforce-all] # increase or add git lfs if too strict
exclude: MODULE.bazel.lock|tests/benchmarks/benchmarks_analysis.md
exclude: MODULE.bazel.lock|tests/benchmarks/benchmarks_analysis.md|src/socom/test/unit/runtime_tests.cpp

- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 38980559e3a605691d6579f96222c30778e5a69e # 3.0.0
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ register_toolchains(
# ============================================================================
# Tooling & Development
# ============================================================================
bazel_dep(name = "score_tooling", version = "1.0.4", dev_dependency = True)
bazel_dep(name = "score_tooling", version = "1.1.2", dev_dependency = True)
bazel_dep(name = "aspect_rules_lint", version = "2.3.0", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "8.5.1", dev_dependency = True)

Expand Down
54 changes: 54 additions & 0 deletions src/socom/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@score_baselibs//score/language/safecpp:toolchain_features.bzl", "COMPILER_WARNING_FEATURES")

filegroup(
name = "headers",
srcs = glob(include = ["include/**"]),
)

cc_library(
name = "socom",
srcs = glob(include = ["src/**"]),
hdrs = [":headers"],
defines = [
"WITH_SOCOM_DEADLOCK_DETECTION=1",
],
features = COMPILER_WARNING_FEATURES,
includes = [
"include",
"src/socom/include",
],
visibility = ["//visibility:public"],
deps = [
"@score_baselibs//score/result",
],
)

filegroup(
name = "mock_headers",
srcs = glob(include = ["mock/**"]),
)

cc_library(
name = "mock",
hdrs = [":mock_headers"],
includes = ["mock"],
visibility = ["//visibility:public"],
deps = [
":socom",
"@googletest//:gtest_for_library",
],
)
36 changes: 36 additions & 0 deletions src/socom/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// *******************************************************************************
// Copyright (c) 2025 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache License Version 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0
//
// SPDX-License-Identifier: Apache-2.0
// *******************************************************************************

= Service Oriented Communication (SOCom)
:description: SOCom
:docinfo: shared
:diagramdir: models
:imagesdir: images
:toc: left
:iconsdir: images
:icons: font
:sectnums:
:sectnumlevels: 5

The bundle service oriented communication (SOCom) implements components for client/server pattern based communication for the following communication paradigms:

* remote procedure call;
* publish/subscribe (event communication).

SOCom provides interfaces which enable the implementation of service gateways (bridges).
This allows users to independently implement service bridges for different communication protocols (e.g. IPC, SOME/IP, …).
SOCom provides intra-process client/server communication only.

== Design

See <<doc/design/README.adoc#,design/>> for a high level design.
81 changes: 81 additions & 0 deletions src/socom/doc/design/30_structural_view.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// *******************************************************************************
// Copyright (c) 2025 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache License Version 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0
//
// SPDX-License-Identifier: Apache-2.0
// *******************************************************************************

////
Every asciidoc file in this document starts with the section level 0, i.e. a section like
....
= Title
....

When the file is included from another file within the document, the levels must be adjusted with the `leveloffset` attribute to the `include` directive at the point of inclusion, e.g.
....
include::file.adoc[leveloffset=+1]
....
////

= Structural View

The bundle service oriented communication (SOCom) implements components for client/server pattern based communication for the following communication paradigms:

* remote procedure call;
* publish/subscribe (event communication).

SOCom provides interfaces which enable the implementation of service gateways (bridges).
This allows users to independently implement service bridges for different communication protocols (e.g. IPC, SOME/IP, …).
SOCom provides intra-process client/server communication only.

.Component diagram of SOCom
[plantuml, svg, align="center"]
....
include::models/component_diagram_socom.puml[]
....

.Software elements

* <<runtime_component>>;
* <<client_connector_component>>;
* <<server_connector_component>>;

[#runtime_component]
== Runtime

The Runtime creates and connects Client_connectors and Server_connectors.
In addition to that it has a plugin interface for adding bridges to cross IPC or network boundaries.
The Runtime must outlive all created Client_connectors and Server_connectors.

[#client_connector_component]
== Client connector

A client application owns and uses this component to join client/server pattern based service oriented communication (SOCom).
The client connector interacts with the server connector in order perform the supported communication primitives.
The client connector API provides the following features:

* service instance state change indications
* asynchronous remote procedure call

** with method reply
** without method reply (fire and forget)

* event subscription

** with optional initial value request (required for fields)

* event subscription acknowledge indication
* event update indication
* requested event update indication

[#server_connector_component]
== Server connector

The Server_connector represents a service, which is used by a Client_connector.
It can send event updates and respond to method calls.
172 changes: 172 additions & 0 deletions src/socom/doc/design/40_behavioral_view.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
// *******************************************************************************
// Copyright (c) 2025 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache License Version 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0
//
// SPDX-License-Identifier: Apache-2.0
// *******************************************************************************

////
Every asciidoc file in this document starts with the section level 0, i.e. a section like
....
= Title
....

When the file is included from another file within the document, the levels must be adjusted with the `leveloffset` attribute to the `include` directive at the point of inclusion, e.g.
....
include::file.adoc[leveloffset=+1]
....
////

= Behavioral View

This component implements the following state machines:

* <<event_subscription_state_machine, event subscription state>>;
* <<service_state_machine, service state>>.

== Runtime

The runtime is a (process internal) service instance broker.
Client connectors and server connectors are created using the runtime (factory), which keeps track of their existence and state.
Depending on the existence and state of the communication partners, the runtime takes care for connecting/disconnecting service interface and service instance compatible client and server connectors.
Additionally, it provides a service instance find interface.

== Server connector

A server application owns and uses this component to join client/server pattern based service oriented communication (SOCom).
The server connector interacts with the client connector in order perform the supported communication primitives.
The server connector API provides the following features:

* remote procedure called indication;
* event subscription state changed indication:

** on first subscriber;
** on last unsubscriber.

* event update request indication;
* event mode getter (event with/without initial update);
* update event;
* update requested event;
* acknowledge event subscription.

== Method Communication

Methods calls are routed 1:1 from client to server application.
If a method reply is requested, the calling client is served with the related reply.
Independent method calls share no state.

.Interaction diagram: Method communication
[plantuml, svg, align="center"]
....
include::models/interaction_diagram_method_communication.puml[]
....

== Event Communication

The client subscribes to an event.
On the subscription, SOCom informs the server using the request for events.
If no client is subscribed to an event, the server will not send any event updates.

After unsubscription of the subscriber, SOCom informs the server that an event is not subscribed anymore.
SOCom keeps track of subscription states and related clients.

.Interaction diagram: Event communication
[plantuml, svg, align="center"]
....
include::models/interaction_diagram_event_communication.puml[]
....

== Field Notification Communication

A field notification is implemented as an event with event update on subscription.

NOTE: Additional behavior compared to field communication:
since SOCom does not save the current event values, SOCom requests an event update from the server for each new subscriber.

Servers answer this request with update_requested_event().
Those updates are indicated to the client which is subscribed and has an initial event update pending.

Regular update_event() calls update for the events of the subscriber and also fulfills the initial event update use-case.
Consequently, update_event() satisfies the event update request implicitly.

.Interaction diagram: Field notification communication
[plantuml, svg, align="center"]
....
include::models/interaction_diagram_field_notification_communication.puml[]
....

== Service Gateway - find service

The creation of client connectors is forwarded to bridges as request_service() calls.
Service bridges look up the required service instance within their domain.
If available, they connect to the remote counterpart and locally create a proxy server connector (forwarding all communication).

.Interaction diagram: Service Gateway - find service
[plantuml, svg, align="center"]
....
include::models/interaction_diagram_service_gateway_find_service.puml[]
....

== Service Gateway - require service

The creation of client connectors is forwarded to bridges as request_service() calls.
Service bridges look up the required service instance within their domain.
If available, they connect to the remote counterpart and locally create a proxy server connector (forwarding all communication).

.Interaction diagram: Service Gateway - require service
[plantuml, svg, align="center"]
....
include::models/interaction_diagram_service_gateway_require_service.puml[]
....

== Service Gateway - provide service

The creation of server connectors is found by service bridges using the SOCom subscribe_find_service() API.
Service bridges provide this information within their domain.
If any domain partner requests the service instance, the service bridge creates a proxy client connector (forwarding all communication).

.Interaction diagram: Service Gateway - provide service
[plantuml, svg, align="center"]
....
include::models/interaction_diagram_service_gateway_provide_service.puml[]
....

== Deadlock detection

In order to facilitate deadlock detection, before a callback is called by a Client_connector or
Server_connector the thread id of the caller is saved.
After the callback returns, the previously saved thread id is removed.
If the calling object is destructed prematurely the deadlock is detected by checking if the thread
id is still present, issuing a warning log and terminating the application.

== Client_connector deadlocks

When a running callback destroys the calling Client_connector a deadlock will happen, which will cause the application to be terminated.

The deadlock is caused because the Client_connector destructor waits for the callback to return.
The callback on the other hand waits for the destructor to return.

.Interaction diagram: Client_connector deadlocks
[plantuml, svg, align="center"]
....
include::models/interaction_diagram_client_connector_deadlocks.puml[]
....

== Server_connector deadlocks

When a running callback destroys the calling Server_connector a deadlock will happen, which will cause the application to be terminated.

The deadlock is caused because the Server_connector destructor waits for the callback to return.
The callback on the other hand waits for the destructor to return.

.Interaction diagram: Server_connector deadlocks
[plantuml, svg, align="center"]
....
include::models/interaction_diagram_server_connector_deadlocks.puml[]
....
Loading
Loading