go2rtc
go2rtc copied to clipboard
Closing connection to a client
A go2rtc stream stays open for 5 seconds (default timeout) even if a client closes the connection properly on their end (i.e. RTCPeerConnection.close() is called).
Problems this could cause:
- (my case) because switching between streams of different cameras causes two streams to temporarily both be active, which overloads the USB hub the 2 cameras are connected through.
- (made up) on a page with live-thumbnails-on-hover, hovering over 10 thumbnails momentarily opens 10 streams for 5 seconds
If this answer is correct, WebRTC does not support a closing a peer connection by a peer message, only by timeout. Lowering this timeout causes unwanted disconnections.
Could go2rtc provide a way to close a connection?
Automatically sending it over e.g. the WebRTC datachannel would be awesome, but I understand if the user is responsible for the messaging to the server.
This is a heavy complication of the protocol and not a standard. There are already many clients to go2rtc. They will not be able to support this without improvements on their part.
Yeah. I would be looking for a way to call e.g. CloseClientById via IPC with the go2rtc binary (since I guess most go2rtc users aren't Go users).
But if you don't want to support something like this, I understand. For now I'm killing Go2rtc and starting it back up as a workaround. I just wish WebRTC supported this :/
Drop client via REST API is a good improvement. Maybe someday when I have time.