javascriptnode.jswebsocketexews

Node js WebSocket (NPM ws) not returning ping response when windows application in minimize mode


I am using NPM ws in my backend project. and i have added ping-pong logic if not getting response of ping in 45 seconds then i'm terminating the web socket connection.

Above logic is working when I'm minimizing the chrome tab I'm still getting the response of ping. But the same code When I'm minimizing the windows application i can see the logs, not getting the response of ping. also i can see the webSocket connection active but not getting the response for ping


Solution

  • After lots of research finally got to know that it's windows UWP process group is suspending processes to improve system performance when windows application on minimized mode.

    https://answers.microsoft.com/en-us/windows/forum/all/this-uwp-process-group-is-suspending-processes-to/bfda4d2a-88ae-4d7d-b0d1-4e26800f4e23

    https://github.com/websockets/ws/issues/2119

    UWP is an abbreviation for Universal Windows Platform, which is a computing platform developed by Microsoft that was introduced with the Windows 10 operating system and will continue to be used in Windows 11.