Skip to content

Commit

Permalink
Fix: Adjust timings
Browse files Browse the repository at this point in the history
  • Loading branch information
therealPaulPlay committed Feb 10, 2025
1 parent b8cce27 commit 6434667
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "playpeerjs",
"version": "1.3.2",
"version": "1.3.3",
"description": "WebRTC-based wrapper for creating robust peer-2-peer multiplayer systems with ease.",
"type": "module",
"main": "dist/playpeer.js",
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default class PlayPeer {
this.#triggerEvent("error", "Failed to close incoming connection (invalid): " + error);
}
}
}, 2 * 1000);
}, 3 * 1000);

// Only process incoming connections if hosting
if (this.#isHost) {
Expand All @@ -216,7 +216,7 @@ export default class PlayPeer {
return;
}
this.#hostConnections?.forEach((e) => {
if (e[1] < Date.now() - 2500) {
if (e[1] < Date.now() - 3000) {
console.warn(WARNING_PREFIX + "Peer did not send heartbeats - closing connection.");
this.#triggerEvent("status", "Peer did not send heartbeats - closing connection.");
try { e[0]?.close(); } catch (error) {
Expand Down

0 comments on commit 6434667

Please sign in to comment.