Support immediate notify of connection listener.

Also only perform immediate notification to the callback actually
requesting the notification, not all existing callbacks.

Offset returned uids by 1 so uid=0 can be used to indicate immediate
notification.
This commit is contained in:
Peter Johnson
2015-08-28 00:13:56 -07:00
parent 302cc064c6
commit b488cdd6ff
10 changed files with 65 additions and 23 deletions

View File

@@ -191,7 +191,8 @@ typedef std::function<void(unsigned int uid, bool connected,
unsigned int AddEntryListener(StringRef prefix, EntryListenerCallback callback,
bool immediate_notify);
void RemoveEntryListener(unsigned int entry_listener_uid);
unsigned int AddConnectionListener(ConnectionListenerCallback callback);
unsigned int AddConnectionListener(ConnectionListenerCallback callback,
bool immediate_notify);
void RemoveConnectionListener(unsigned int conn_listener_uid);
/*