mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-02 23:38:45 +00:00
livekit_signaller: Improved shutdown behavior
Without sending a Leave request to the server before disconnecting, the disconnected client will appear present and stuck in the room for a little while until the server removes it due to inactivity. After this change, the disconnecting client will immediately leave the room. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1482>
This commit is contained in:
parent
9c590f4223
commit
002dc36ab9
1 changed files with 12 additions and 1 deletions
|
@ -516,6 +516,17 @@ impl Signaller {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn close_signal_client(signal_client: &signal_client::SignalClient) {
|
||||
signal_client
|
||||
.send(proto::signal_request::Message::Leave(proto::LeaveRequest {
|
||||
can_reconnect: false,
|
||||
reason: proto::DisconnectReason::ClientInitiated as i32,
|
||||
..Default::default()
|
||||
}))
|
||||
.await;
|
||||
signal_client.close().await;
|
||||
}
|
||||
}
|
||||
|
||||
impl SignallableImpl for Signaller {
|
||||
|
@ -745,7 +756,7 @@ impl SignallableImpl for Signaller {
|
|||
|
||||
if let Some(connection) = self.connection.lock().unwrap().take() {
|
||||
block_on(connection.signal_task).unwrap();
|
||||
block_on(connection.signal_client.close());
|
||||
block_on(Self::close_signal_client(&connection.signal_client));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue