Correct way of detecting disconnection?

I am creating a new mediasoup implementation in UDP. I don’t have any signaling protocol to detect the disconnection of users, as I am broadcasting with OBS with WHIP.
What would be the proper way of detecting the disconnection of the broadcaster?

You need a keep alive state, so this just means that you can detect if user isn’t sending for x amount of time the session is canceled. So regardless of UDP or TCP based protocol you should be able to replicate the type of mechanism with code to monitor the activity.