Skip to content

Commit

Permalink
remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Feb 15, 2025
1 parent 30cd09d commit e500d10
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions src/services/Server/WebSocketClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,38 +180,6 @@ export default class WebSocketClient {
this.sendMessage(pingMessage, true);
}

/**
* Cleanup websocket connection and intervals
*/
cleanup() {
this.isCleanedUp = true;

if (this.websocket) {
try {
this.websocket.onopen = null;
this.websocket.onmessage = null;
this.websocket.onclose = null;
this.websocket.close();
} catch (error) {
console.warn("WebSocket cleanup error:", error);
}
this.websocket = null;
}

if (this.pingHandle) {
clearInterval(this.pingHandle);
this.pingHandle = null;
}

if (this.reconnectionHandle) {
clearTimeout(this.reconnectionHandle);
this.reconnectionHandle = null;
}

this.reconnectionAttempts = 0;
this.queuedMessages = [];
}

/**
* Handles websocket close events, attempting to reconnect
*
Expand Down

0 comments on commit e500d10

Please sign in to comment.