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

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

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.