How to Disconnect a User from Socket via Socket

Hi.
We have a socket setup where a message is emitted from client every 5 minutes.
But for some reason, for 1 user, this has malfunctioned. From their system, its being called every few ms. From what we could understand, the user left their tab open and now the socket is continuously emitting via socket.
Due to this, the server CPU utilization is at 85-90%.

I checked the socket options in Wappler, but could not find any way to disconnect a user or even change the definition of socket so all existing users might get disconnected and then reconnect after a refresh/logout only.

In the current scenario, I had to delete the particuar socket message and create a new one. Now every time this user’s browser tries to send an emitt, the server just throws a file not found exception. The CPU usage is back to normal, but I still have this unwanted burst of requests coming in.

What can I do here? How do I disconnect this user and also put in some safeguard - if such a thing was to happen again?

Community Page
Last updated: