diff --git a/package.json b/package.json index c316d32..f528555 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.js b/src/index.js index b579f02..c5bbd0e 100644 --- a/src/index.js +++ b/src/index.js @@ -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) { @@ -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) {