Move immediate connection notification logic into Dispatcher.

This prevents a race condition that could result in out of order
notifications.
This commit is contained in:
Peter Johnson
2017-09-30 23:37:02 -07:00
parent e4a8bff70e
commit e68a71022c
6 changed files with 48 additions and 14 deletions

View File

@@ -56,6 +56,12 @@ class DispatcherBase : public IDispatcher {
std::vector<ConnectionInfo> GetConnections() const;
bool IsConnected() const;
unsigned int AddListener(
std::function<void(const ConnectionNotification& event)> callback,
bool immediate_notify) const;
unsigned int AddPolledListener(unsigned int poller_uid,
bool immediate_notify) const;
void SetConnector(Connector connector);
void SetConnectorOverride(Connector connector);
void ClearConnectorOverride();