[−][src]Struct webrtc_unreliable::RtcServer
Methods
impl RtcServer
[src]
pub fn new(
http_listen_addr: SocketAddr,
udp_listen_addr: SocketAddr,
public_udp_addr: SocketAddr
) -> Result<RtcServer, RtcInternalError>
[src]
http_listen_addr: SocketAddr,
udp_listen_addr: SocketAddr,
public_udp_addr: SocketAddr
) -> Result<RtcServer, RtcInternalError>
pub fn is_connected(&self, remote_addr: &SocketAddr) -> bool
[src]
Returns true if the client has a completely established WebRTC data channel connection and can send messages back and forth. Returns false for disconnected clients as well as those that are still starting up or are in the process of shutting down.
pub fn disconnect(&mut self, remote_addr: &SocketAddr)
[src]
Disconect the given client, does nothing if the client is not currently connected.
pub fn poll_send(
&mut self,
message: &[u8],
message_type: RtcMessageType,
remote_addr: &SocketAddr
) -> Poll<(), RtcError>
[src]
&mut self,
message: &[u8],
message_type: RtcMessageType,
remote_addr: &SocketAddr
) -> Poll<(), RtcError>
Send the given message to the given remote client, if they are connected.
pub fn poll_recv(&mut self, buf: &mut [u8]) -> Poll<RtcMessageResult, RtcError>
[src]
Receive a WebRTC data channel message from any connected client.
poll_recv
must be called until it returns Async::NotReady for proper operation of the
server, as it also handles background tasks such as responding to STUN packets, timing out
existing sessions, and handling HTTP requests.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.