pub trait IsReady: GnsDroppable {
    fn queue(&self) -> &SegQueue<GnsConnectionEvent>;
    fn receive<const K: usize>(
        &self,
        gns: &GnsSocket<'_, '_, Self>,
        messages: &mut [GnsNetworkMessage<ToReceive>; K]
    ) -> usize; }
Expand description

Common functions available for any GnsSocket state that is implementing it. Regardless of being a client or server, a ready socket will allow us to query for connection events as well as receive messages.

Required Methods

Return a reference to the connection event queue. The queue is thread-safe.

Poll for incoming messages. K represent the maximum number of messages we are willing to receive. Return the actual number of messsages that has been received.

Implementors