class

XMPP::SMState

Inherits Reference / Object

SMState holds Stream Management information regarding the session that can be used to resume session after disconnect

Constructors

new(id : String = "", inbound : UInt32 = 0_u32, outbound : UInt32 = 0_u32, location : String = "", max : UInt32 = 0_u32, timestamp : Time = Time.utc, error : String = "")
Source

Instance methods

can_resume?

Check if this state is valid for resumption

Source
clear_queue

Clear the unacknowledged queue (after successful resend)

Source
error
Source
error=(error : String)
Source
has_unacked_stanzas?

Check if we have unacknowledged stanzas

Source
id=(id : String)
Source
inbound
Source
inbound=(inbound : UInt32)
Source
location
Source
location=(location : String)
Source
max=(max : UInt32)
Source
outbound
Source
outbound=(outbound : UInt32)
Source
process_ack(h : UInt32)

Process acknowledgement from server Server sends the count of stanzas it has received

Source
queue_stanza(stanza : String, max_size : Int32 | Nil = nil)

Add a stanza to the unacknowledged queue

Source
resumption_expired?

Check if resumption should be attempted based on max time

Source
stanzas_to_resend

Get stanzas that need to be resent

Source
timestamp
Source
timestamp=(timestamp : Time)
Source
touch

Update timestamp to current time

Source
unacked_count
Source
unacked_stanzas

Return a snapshot so callers cannot mutate the queue without synchronization.

Source