Skip to content

Commit

Permalink
introduce websocket reconnect strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
thesyncim committed Apr 24, 2024
1 parent 75895e7 commit 9c66626
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions protobuf/video/sfu/event/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ message PinsChanged {

message Error {
models.Error error = 4;
// returns the reconnect strategy to be used by the client
models.WebsocketReconnectStrategy reconnect_strategy = 5;
}

message ICETrickle {
Expand Down
18 changes: 17 additions & 1 deletion protobuf/video/sfu/models/models.proto
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,20 @@ enum CallEndedReason {
CALL_ENDED_REASON_ENDED = 1;
CALL_ENDED_REASON_LIVE_ENDED = 2;
CALL_ENDED_REASON_KICKED = 3;
}
}

// WebsocketReconnectStrategy defines the ws strategies available for handling reconnections.
enum WebsocketReconnectStrategy {
WEBSOCKET_RECONNECT_STRATEGY_UNSPECIFIED = 0;
// Sent after reaching the maximum reconnection attempts, leading to a disconnection.
WEBSOCKET_RECONNECT_STRATEGY_DISCONNECT = 1;
// SDK should maintaining existing publisher/subscriber pc instances
// and establish a new WebSocket connection.
WEBSOCKET_RECONNECT_STRATEGY_FAST = 2;
// SDK should drop existing pc instances and creates a fresh WebSocket connection,
// ensuring a clean state for the reconnection.
WEBSOCKET_RECONNECT_STRATEGY_CLEAN = 3;
// SDK should obtain new credentials from the coordinator, drops existing pc instances, and initializes
// a completely new WebSocket connection, ensuring a comprehensive reset.
WEBSOCKET_RECONNECT_STRATEGY_FULL = 4;
};

0 comments on commit 9c66626

Please sign in to comment.