Skip to content

Commit c82cc61

Browse files
error fixes, adjust timeout
1 parent 79db839 commit c82cc61

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ export default class PlayPeer {
170170
incomingConnection.close();
171171
this.#hostConnections.delete(incomingConnection);
172172
} catch (error) {
173-
console.error(WARNING_PREFIX + "Error closing invalid connection:", error);
173+
console.error(ERROR_PREFIX + "Error closing invalid connection:", error);
174174
}
175175
}
176-
}, 10 * 1000);
176+
}, 3 * 1000);
177177

178178
// Only process incoming connections if hosting
179179
if (this.#isHost) {
@@ -291,7 +291,7 @@ export default class PlayPeer {
291291
console.error(ERROR_PREFIX + "Connection attempt for joining room timed out.");
292292
this.#triggerEvent("status", "Connection attempt for joining room timed out.");
293293
reject(new Error("Connection attempt for joining room timed out."));
294-
}, 10 * 1000);
294+
}, 3 * 1000);
295295

296296
this.#outgoingConnection.on("open", () => {
297297
clearTimeout(timeout);
@@ -412,7 +412,7 @@ export default class PlayPeer {
412412
try {
413413
connection.send(message);
414414
} catch (error) {
415-
console.error(WARNING_PREFIX + `Failed to send broadcast message to peer ${connection.peer}:`, error);
415+
console.error(ERROR_PREFIX + `Failed to send broadcast message to peer ${connection.peer}:`, error);
416416
this.#triggerEvent("error", `Failed to send broadcast message to peer ${connection.peer}: ${error}`);
417417
}
418418
}

0 commit comments

Comments
 (0)