Trait bones_framework::external::ggrs::NonBlockingSocket
pub trait NonBlockingSocket<A>: Send + Sync{
// Required methods
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§
fn receive_all_messages(&mut self) -> Vec<(A, Message)>
fn receive_all_messages(&mut self) -> Vec<(A, Message)>
This method should return all messages received since the last time this method was called.
The pairs (A, Message)
indicate from which address each packet was received.