pub struct WebRtcServer { /* private fields */ }
Expand description
A WebRTC server brings the ability to listen on a single UDP/TCP port for multiple
WebRtcTransport
s.
A WebRTC server exists within the context of a Worker
, meaning that if your app launches N
workers it also needs to create N WebRTC servers listening on different ports (to not collide).
The WebRTC transport implementation of mediasoup is
ICE Lite, meaning that it does not initiate
ICE connections but expects ICE Binding Requests from endpoints.
Implementations§
Source§impl WebRtcServer
impl WebRtcServer
Sourcepub fn id(&self) -> WebRtcServerId
pub fn id(&self) -> WebRtcServerId
Router id.
Sourcepub fn on_worker_close<F: FnOnce() + Send + 'static>(
&self,
callback: F,
) -> HandlerId
pub fn on_worker_close<F: FnOnce() + Send + 'static>( &self, callback: F, ) -> HandlerId
Callback is called when the worker this WebRTC server belongs to is closed for whatever
reason.
The WebRtc server itself is also closed. A on_webrtc_server_close
callbacks are
triggered in all relevant WebRTC transports.
Sourcepub fn on_new_webrtc_transport<F>(&self, callback: F) -> HandlerId
pub fn on_new_webrtc_transport<F>(&self, callback: F) -> HandlerId
Callback is called when new WebRtcTransport
is added that uses this WebRTC server.
Trait Implementations§
Source§impl Clone for WebRtcServer
impl Clone for WebRtcServer
Source§fn clone(&self) -> WebRtcServer
fn clone(&self) -> WebRtcServer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more