Commit Graph
24 Commits
Author SHA1 Message Date
Taras Zaporozhets 299e6940cd Improve ABI 2022-10-30 18:17:51 +01:00
Taras Zaporozhets 3f825ffb30 Force event loop to re-enter processing to handle queued messages 2022-09-04 23:26:14 +02:00
alivenetsandStanislav Angelovic 0f2362d8c3 feat: add support for session bus connection at custom address (#273)
* Add methods to initiate custom session bus connection

The new function helper `createSessionBusConnectionWithAddress` allows to create connection to session bus with custom address.

Signed-off-by: Alexander Livenets <a.livenets@gmail.com>

* feat: add support for session bus connection at custom address

Co-authored-by: Stanislav Angelovic <stanislav.angelovic@siemens.com>
2022-08-08 13:54:09 +02:00
Stanislav Angelovic e07c1f3981 chore: update doxygen header info 2022-07-05 18:10:05 +02:00
Stanislav Angelovic 4e105081c9 fix: remove executable flag from source files 2022-06-27 12:17:18 +02:00
Stanislav Angelovic 5ec6027d5f feat: add support for match rules 2022-06-27 12:14:57 +02:00
Stanislav Angelovic d864e1dfa4 refactor: rename dont_request_slot tag to floating_slot 2022-06-27 12:05:06 +02:00
Stanislav Angelovic b7f3d7c876 refactor: little fixes and reorganizations around Connection class 2022-06-22 18:12:42 +02:00
Stanislav Angelovic b8eb0e8ceb fix: minor fixes for async timeout handling 2021-12-21 13:52:14 +01:00
bb0f3f0242 Fix #88: Timeout handling. (#91)
fix timeout handling

* Despite what is documented in sd_bus_get_timeout(3), the timeout
  returned is actually an absolute time point of Linux's CLOCK_MONOTONIC
  clock. Hence, we first have to subtract the current time from the
  timeout in order to get a relative time that can be passed to poll.

* For async call timeouts to reliably work, we need a way to notify the
  event loop of a connection that is currently blocked waiting in poll.
  I.e. assume the event loop thread entered poll with a timeout set to
  T1. Afterwards, the main thread starts an async call C with a timeout
  T2 < T1. In order for C to be canceled after its timeout T1 has
  elapsed, we have to be able to notify the event loop so that it can
  update its poll data.

Co-authored-by: Urs Ritzmann <ursritzmann@protonmail.ch>
Co-authored-by: Lukasz Marcul <lukasz.marcul@onemeter.com>
2021-12-20 10:00:29 +01:00
David Leeds 75ea127374 connection: add createDefaultBusConnection()
This internally calls sd_bus_open(), which automatically selects the
system or session bus connection based on the presence and 
content of a DBUS_STARTER_BUS_TYPE environment variable and
whether the calling process has root privileges.

This option is very helpful when creating services and clients that will use the system bus in production, but connect to a session
for testing.

Additional changes:
* Removed assertions null-checking make_unique() return values.
  make_unique() calls new, and new is expected to throw or abort
  on failure, making the assertions unhelpful.
* Corrected a typo in the ClosesAndUnrefsBusWhenDestructed
  unit test for the system bus (tested the wrong function).
2021-06-21 15:55:23 +02:00
sangelovic 3a4f343fb9 Provide better names to event loop-related IConnection methods 2020-02-02 22:22:26 +01:00
sangelovic 975f1bf07f Switch to fully supported C++17 2020-02-01 22:58:34 +01:00
sangelovic 839bc13625 Make Connection const-correct and fix integration tests build error 2019-11-10 17:40:33 +01:00
Bruno Marchand 5fe0f503ca Add a method to retrieve the unique name of a connection 2019-11-10 17:34:57 +01:00
Jay 099bc857ad Add support for opening a connection to a remote system bus using ssh (#77) 2019-11-03 20:21:39 +01:00
lubo-svk c139110112 Add support for custom timeout value for D-Bus method calls (#72) 2019-11-03 13:54:13 +01:00
hogliux 0440dcb15b Added ability to integrate with foreign event loops 2019-10-08 22:09:05 +02:00
Stanislav Angelovic ab34b0ae50 Update header doxy comments in source files 2019-06-11 20:18:37 +02:00
sangelovic 946cc8d0cd Fix indentation of doxygen comments 2019-06-04 22:21:49 +02:00
Stanislav Angelovič 91fa35140b Add support for ObjectManager and other standard D-Bus interfaces (#55)
Fixes #50
2019-05-29 22:28:15 +02:00
Stanislav Angelovič 4b0c23204d Add object manager support to IConnection interface (#54) 2019-05-27 20:51:42 +02:00
sangelovic 878ce6fa5c Update doxygen documentation as well as tutorial 2019-03-29 22:23:25 +01:00
Stanislav Angelovic 35f725a053 Introduce sdbus-c++ v0.2.3 2017-11-27 14:13:55 +01:00