handle_incoming

Function handle_incoming 

fn handle_incoming(
    pkt: &Packet<'_>,
    client: &mut Client<JournaledSession>,
    outbound: &mut PacketWriter<GrowBuffer>,
    pending: &mut Pending,
    inbound_aliases: &mut InboundAliases,
    outbound_aliases: &mut OutboundAliases,
    pending_messages: &mut VecDeque<Message>,
) -> Option<(DisconnectReason, bool)>
Expand description

Handles one decoded inbound packet: runs it through the client state machine, enqueues any response, and buffers a received message for delivery to the application.

Buffering keeps protocol processing (acknowledgements, keep-alive) from waiting on the application: the coordinator drains pending_messages to the application separately and stops reading inbound packets once the buffer is full.

Returns Some((reason, graceful)) when the connection should end.