XmppConnection class

This class is a connection to the server.

Constructors

XmppConnection(ReconnectionPolicy reconnectionPolicy, ConnectivityManager connectivityManager, NegotiationsHandler _negotiationsHandler, BaseSocketWrapper _socket, {Duration connectingTimeout = const Duration(minutes: 2)})

Properties

connectingTimeout Duration
The time that we may spent in the "connecting" state
final
connectionSettings ConnectionSettings
Connection settings
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isAuthenticated bool
no setter
reconnectionPolicy ReconnectionPolicy
no setter
resource String
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

asBroadcastStream() Stream<XmppEvent>
Returns the connection's events as a stream.
connect({bool? shouldReconnect, bool waitForConnection = false, bool waitUntilLogin = false, bool enableReconnectOnSuccess = true}) Future<Result<bool, XmppError>>
Start the connection process using the provided connection settings.
disconnect() Future<void>
Attempt to gracefully close the session
generateId() String
Generate an Id suitable for an origin-id or stanza id
getConnectionState() Future<XmppConnectionState>
Returns the ConnectionState of the connection
getCSIManager() CSIManager?
Returns the registered CSIManager, if one is registered.
getDiscoManager() DiscoManager?
Returns the registered DiscoManager.
getManagerById<T extends XmppManagerBase>(String id) → T?
Returns the Manager with id id or null if such a manager is not registered.
getNegotiatorById<T extends XmppFeatureNegotiatorBase>(String id) → T?
getPresenceManager() PresenceManager?
A PresenceManager is required, so have a wrapper for getting it. Returns the registered PresenceManager.
getRosterManager() RosterManager?
Returns the registered RosterManager.
getRoutingState() → RoutingState
NOTE: For debugging purposes only Returns the internal state of the state machine
getStreamManagementManager() StreamManagementManager?
Returns the registered StreamManagementManager, if one is registered.
handleError(XmppError error) Future<void>
Called when a stream ending error has occurred
handleSocketEvent(XmppSocketEvent event) Future<void>
Called whenever the socket creates an event
handleXmlStream(XMPPStreamObject event) Future<void>
Called whenever we receive data that has been parsed as XML.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerFeatureNegotiators(List<XmppFeatureNegotiatorBase> negotiators) Future<void>
Register a list of negotiator with the connection.
registerManagers(List<XmppManagerBase> managers) Future<void>
Registers a list of XmppManagerBase sub-classes as managers on this connection.
sendRawString(String raw) → void
Sends raw to the server.
sendRawXML(XMLNode node) → void
Sends an XMLNode without any further processing to the server.
sendStanza(StanzaDetails details) Future<XMLNode?>
Sends a stanza described by details to the server. Until sent, the stanza is kept in a queue, that is flushed after going online again. If Stream Management is active, stanza's acknowledgement is tracked.
sendWhitespacePing() → void
Sends an empty String over the socket.
setResource(String resource, {bool triggerEvent = true}) → void
Sets the resource of the connection
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited