Struct ggrs::UdpNonBlockingSocket
source · [−]pub struct UdpNonBlockingSocket { /* private fields */ }
Expand description
A simple non-blocking UDP socket tu use with GGRS Sessions. Listens to 0.0.0.0 on a given port.
Implementations
sourceimpl UdpNonBlockingSocket
impl UdpNonBlockingSocket
sourcepub fn bind_to_port(port: u16) -> Result<Self, Error>
pub fn bind_to_port(port: u16) -> Result<Self, Error>
Binds an UDP Socket to 0.0.0.0:port and set it to non-blocking mode.
Trait Implementations
sourceimpl Debug for UdpNonBlockingSocket
impl Debug for UdpNonBlockingSocket
sourceimpl NonBlockingSocket<SocketAddr> for UdpNonBlockingSocket
impl NonBlockingSocket<SocketAddr> for UdpNonBlockingSocket
sourcefn send_to(&mut self, msg: &Message, addr: &SocketAddr)
fn send_to(&mut self, msg: &Message, addr: &SocketAddr)
Takes an UdpMessage
and sends it to the given address.
sourcefn receive_all_messages(&mut self) -> Vec<(SocketAddr, Message)>
fn receive_all_messages(&mut self) -> Vec<(SocketAddr, Message)>
This method should return all messages received since the last time this method was called.
The pairs (A, UdpMessage)
indicate from which address each packet was received. Read more
Auto Trait Implementations
impl RefUnwindSafe for UdpNonBlockingSocket
impl Send for UdpNonBlockingSocket
impl Sync for UdpNonBlockingSocket
impl Unpin for UdpNonBlockingSocket
impl UnwindSafe for UdpNonBlockingSocket
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more