Struct naia_shared::BaseConnection [−][src]
pub struct BaseConnection<P: ProtocolType> { /* fields omitted */ }
Expand description
Represents a connection to a remote host, and provides functionality to manage the connection and the communications to it
Implementations
Create a new BaseConnection, given the appropriate underlying managers
Record that a message has been sent (to prevent needing to send a heartbeat)
Returns whether a heartbeat message should be sent
Record that a message has been received from a remote host (to prevent disconnecting from the remote host)
Returns whether this connection should be dropped as a result of a timeout
pub fn process_incoming_header(
&mut self,
header: &StandardHeader,
packet_notifiable: &mut Option<&mut dyn PacketNotifiable>
)
pub fn process_incoming_header(
&mut self,
header: &StandardHeader,
packet_notifiable: &mut Option<&mut dyn PacketNotifiable>
)
Process an incoming packet, pulling out the packet index number to keep track of the current RTT, and sending the packet to the AckManager to handle packet notification events
Given a packet payload, start tracking the packet via it’s index, attach the appropriate header, and return the packet’s resulting underlying bytes
Get the next outgoing packet’s index
Queue up a message to be sent to the remote host
Returns whether there are messages to be sent to the remote host
Pop the next outgoing message from the queue
If for some reason the next outgoing message could not be written into a message and sent, place it back into the front of the queue
pub fn process_message_data(
&mut self,
reader: &mut PacketReader<'_>,
manifest: &Manifest<P>,
packet_index: u16
)
pub fn process_message_data(
&mut self,
reader: &mut PacketReader<'_>,
manifest: &Manifest<P>,
packet_index: u16
)
Given an incoming packet which has been identified as an message, send the data to the MessageManager for processing
Get the most recent message that has been received from a remote host
Get the address of the remote host
Get the latest received tick from the remote host