ruby-dbus icon indicating copy to clipboard operation
ruby-dbus copied to clipboard

Close dbus connection?

Open swistaczek opened this issue 12 years ago • 2 comments

Hello @mvidner, I would like to ask you if there is any option to close DBus connection? I am iterating through Modem Manager modems and after gathering some information I would like to close dbus connection.

swistaczek avatar Apr 30 '13 02:04 swistaczek

The library currently does not care about closing the connection. That is bad form but I wonder whether it actually hurts in practice. You can get at the socket used by the connection and close it yourself, but please be aware that I consider the socket attribute an implementation detail that may be moved somewhere else.

mvidner avatar May 02 '13 08:05 mvidner

Notes to self: Things to consider when adding DBus::Connection#close:

  • what about non-empty @buffer, do we care?
  • what about the singleton instances DBus.system_bus, DBus.session_bus? Should we allow reopening? Or replacing with a new object?

DBus::ConnectionQueue#close exists in the multithreading branch.

mvidner avatar May 02 '13 08:05 mvidner