[][src]Struct webrtc_unreliable::RtcServer

pub struct RtcServer { /* fields omitted */ }

Methods

impl RtcServer[src]

pub fn new(
    http_listen_addr: SocketAddr,
    udp_listen_addr: SocketAddr,
    public_udp_addr: SocketAddr
) -> Result<RtcServer, RtcInternalError>
[src]

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]

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

impl Send for RtcServer

impl !Sync for RtcServer

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Erased for T