Skip to content
Snippets Groups Projects
Commit 7d128fac authored by Adrien Béraud's avatar Adrien Béraud Committed by Philippe Gorley
Browse files

dring: remove pollEvents API

Change-Id: I37ef6f70abdfa39ae0fc8c89e271565cf3cea4e5
parent 08d0c727
No related branches found
No related tags found
No related merge requests found
...@@ -72,12 +72,6 @@ DBusClient::DBusClient(int flags, bool persistent) ...@@ -72,12 +72,6 @@ DBusClient::DBusClient(int flags, bool persistent)
DBus::_init_threading(); DBus::_init_threading();
DBus::default_dispatcher = dispatcher_.get(); DBus::default_dispatcher = dispatcher_.get();
// timeout and expired are deleted internally by dispatcher_'s
// destructor, so we must NOT delete them ourselves.
timeout_.reset(new DBus::DefaultTimeout {10 /* ms */, true, dispatcher_.get()});
// Poll for Deamon events
timeout_->expired = new EventCallback {DRing::pollEvents};
DBus::Connection sessionConnection {DBus::Connection::SessionBus()}; DBus::Connection sessionConnection {DBus::Connection::SessionBus()};
sessionConnection.request_name("cx.ring.Ring"); sessionConnection.request_name("cx.ring.Ring");
...@@ -116,7 +110,6 @@ DBusClient::~DBusClient() ...@@ -116,7 +110,6 @@ DBusClient::~DBusClient()
presenceManager_.reset(); presenceManager_.reset();
configurationManager_.reset(); configurationManager_.reset();
callManager_.reset(); callManager_.reset();
timeout_.reset();
} }
int int
...@@ -264,7 +257,6 @@ DBusClient::exit() noexcept ...@@ -264,7 +257,6 @@ DBusClient::exit() noexcept
{ {
try { try {
dispatcher_->leave(); dispatcher_->leave();
timeout_->expired = new EventCallback([] {});
finiLibrary(); finiLibrary();
} catch (const DBus::Error& err) { } catch (const DBus::Error& err) {
std::cerr << "quitting: " << err.name() << ": " << err.what() << std::endl; std::cerr << "quitting: " << err.name() << ": " << err.what() << std::endl;
......
...@@ -27,13 +27,8 @@ ...@@ -27,13 +27,8 @@
namespace DRing { namespace DRing {
/** /**
* Finalizes libsflphone, freeing any resource allocated by the library. * Finalizes the daemon, freeing any resource allocated by the library.
*/ */
void fini(void); void fini(void);
/**
* Poll for events
*/
void pollEvents(void);
} }
...@@ -157,8 +157,7 @@ osxTests() ...@@ -157,8 +157,7 @@ osxTests()
return -1; return -1;
while (true) { while (true) {
DRing::pollEvents(); std::this_thread::sleep_for(std::chrono::seconds(1));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
} }
DRing::fini(); DRing::fini();
......
...@@ -178,7 +178,6 @@ run() ...@@ -178,7 +178,6 @@ run()
return -1; return -1;
while (loop) { while (loop) {
DRing::pollEvents();
Sleep(1000); // milliseconds Sleep(1000); // milliseconds
} }
......
...@@ -61,14 +61,6 @@ bool start(const std::string& config_file={}) noexcept; ...@@ -61,14 +61,6 @@ bool start(const std::string& config_file={}) noexcept;
*/ */
void fini() noexcept; void fini() noexcept;
/**
* Poll daemon events.
* This function has to be called by user at a fixed frequency
* to let daemon checks its internal ressources and io and
* manages events reported by them.
*/
void pollEvents() noexcept;
/* External Callback Dynamic Utilities /* External Callback Dynamic Utilities
* *
* The library provides to users a way to be acknowledged * The library provides to users a way to be acknowledged
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment