EpicGamesExt / PixelStreamingInfrastructure

The official Pixel Streaming servers and frontend.
MIT License
200 stars 75 forks source link

Add Heartbeat to websocket connection between Frontend and SignallingServer #34

Open rotor-antoine opened 5 months ago

rotor-antoine commented 5 months ago

Component your feature request relates to

Problem your feature solves? Please describe. The Frontend Library is not triggering disconnection event when I for instance turn off the wifi of my laptop (which is running the frontend). Same issue on the Signalling Server. Those kind of "disconnection" wouldn't trigger an event that could be handle by the signalling server . I know that this repo is not supposed to be necessarily "production ready" but this issue could almost be considered a "bug" as the signalling server will never recover (ie it will never be availalble for a new user) when this type of disconnection with the frontend happen.

Describe the solution you'd like It seems like a hearbeat check (regular ping messages) both from frontend and from the signalling server, would be able to detect those disconnections: https://github.com/websockets/ws?tab=readme-ov-file#how-to-detect-and-close-broken-connections

Additional context Add any other context or screenshots about the feature request here.

lukehb commented 5 months ago

This is a good idea.

I think this is a reasonable suggestion to include in our 5.5 release for the signaling server.

marospekarik commented 5 months ago

This would also fix my problem with cloudfare terminating inactive ws connections after 90s. +1