pub struct Controller { /* private fields */ }
Expand description
The controller of the turn server is used to control the server and obtain server information through the HTTP interface
Implementations§
Source§impl Controller
impl Controller
Sourcepub fn new(server: &str) -> Result<Self, Error>
pub fn new(server: &str) -> Result<Self, Error>
Create a controller by specifying the listening address of the turn
server api interface, such as http://localhost:3000
Sourcepub async fn get_info(&self) -> Option<Message<Info>>
pub async fn get_info(&self) -> Option<Message<Info>>
Get the information of the turn server, including version information, listening interface, startup time, etc.
Sourcepub async fn get_session(&self, query: &SessionAddr) -> Option<Message<Session>>
pub async fn get_session(&self, query: &SessionAddr) -> Option<Message<Session>>
Get session information. A session corresponds to each UDP socket. It should be noted that a user can have multiple sessions at the same time.
Sourcepub async fn get_session_statistics(
&self,
query: &SessionAddr,
) -> Option<Message<Statistics>>
pub async fn get_session_statistics( &self, query: &SessionAddr, ) -> Option<Message<Statistics>>
Get session statistics, which is mainly the traffic statistics of the current session
Sourcepub async fn remove_session(&self, query: &SessionAddr) -> Option<Message<bool>>
pub async fn remove_session(&self, query: &SessionAddr) -> Option<Message<bool>>
Delete the session. Deleting the session will cause the turn server to delete all routing information of the current session. If there is a peer, the peer will also be disconnected.