commit | 0ea2cc3c94acfe5ade74ca7d8be6f82973ad9e88 | [log] [tgz] |
---|---|---|
author | Asim Shankar <ashankar@google.com> | Tue May 31 13:26:12 2016 -0700 |
committer | Asim Shankar <ashankar@google.com> | Wed Jun 01 01:29:53 2016 +0000 |
tree | cb9b08b5f712dc5e9f52d3888c12ceeb20128536 | |
parent | b96b753b815feea5800f3f5711e542539400cf12 [diff] |
lib/discovery: Prevent plugins from stomping on each other. Prior to this commit, when multiple plugins are used for discovery then events from one could stomp those from the other. For example, consider two devices that have both mDNS and BLE connectivity to each other. Services advertised will be picked up on both channels. If they move out of BLE range (but are still on the same IP network), then the "Lost" event from the BLE plugin would be delivered to the client which might then mistakenly determine that the advertisement is no longer valid (even though the mDNS plugin still sees it). This commit fixes that by introducing reference counts per-plugin. "Lost" events are delivered to the client only if *all* plugins that previously saw an advertisement no longer see it. The test added in discovery_test.go tests this behavior and fails without the corresponding changes in scan.go Change-Id: I455ba4c0b7c3211e2b8db84c53086a147e1d7587
This repository contains a reference implementation of the Vanadium APIs.
Unlike the APIs in https://github.com/vanadium/go.v23, which promises to provide backward compatibility this repository makes no such promises.