mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-25 01:41:40 +00:00
Added proper state machine to websocket video stream to control connect/disconnect sequence better. (#561)
This commit is contained in:
@@ -69,10 +69,13 @@ public class SocketVideoStreamManager {
|
||||
// Indicate a user would like to stop receiving one camera stream
|
||||
public void removeSubscription(WsContext user) {
|
||||
var port = userSubscriptions.get(user);
|
||||
if (port != null) {
|
||||
if (port != null && port != NO_STREAM_PORT) {
|
||||
var stream = streams.get(port);
|
||||
userSubscriptions.put(user, NO_STREAM_PORT);
|
||||
stream.removeUser();
|
||||
} else {
|
||||
logger.error(
|
||||
"User attempted to unsubscribe, but had not yet previously subscribed successfully.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user