Trait ggrs::NonBlockingSocket
source · [−]pub trait NonBlockingSocket<A> where
A: Clone + PartialEq + Eq + Hash, {
fn send_to(&mut self, msg: &Message, addr: &A);
fn receive_all_messages(&mut self) -> Vec<(A, Message)>;
}
Expand description
This NonBlockingSocket
trait is used when you want to use GGRS with your own socket.
However you wish to send and receive messages, it should be implemented through these two methods.
Messages should be sent in an UDP-like fashion, unordered and unreliable.
GGRS has an internal protocol on top of this to make sure all important information is sent and received.
Required methods
Takes an UdpMessage
and sends it to the given address.