mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2026-10-25 13:40:28 +00:00
Batch mDNS discovery callbacks to every 500 ms
This commit is contained in:
1 parent
9536c3f8c8
commit
e6f4247ae8
1 file changed
+2
-2
@@ -142,13 +142,13 @@ ServiceFinder.prototype.onReceive_ = function(info) {
|
|||||||
byIP[ptr] = true;
|
byIP[ptr] = true;
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
// Ping! Something new is here. Only update every 25ms.
|
// Ping! Something new is here. Only update every 500ms.
|
||||||
if (!this.callback_pending_) {
|
if (!this.callback_pending_) {
|
||||||
this.callback_pending_ = true;
|
this.callback_pending_ = true;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
this.callback_pending_ = undefined;
|
this.callback_pending_ = undefined;
|
||||||
this.callback_();
|
this.callback_();
|
||||||
}.bind(this), 25);
|
}.bind(this), 500);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user