xmppStreamDidAuthenticate Keeps getting called again and again

46 views
Skip to first unread message

Demonized Darkness

unread,
Nov 1, 2021, 7:58:13 AM11/1/21
to XMPPFramework
i am implementing xmpp chat in ios swift, the problem which is face is that "

xmppStreamDidAuthenticate" this delegate keeps getting called over and over again after few seconds, i am not sure what is problem can someone guide ?

sirob...@gmail.com

unread,
Nov 1, 2021, 9:46:27 AM11/1/21
to XMPPFramework
Hi,

I don't think this is a framework issue.
Just because it's never happened before doesn't mean it can't :)
Can you change server...

Siarhei Brazil

unread,
Nov 2, 2021, 3:14:21 AM11/2/21
to XMPPFramework

I confirm it doesn't happen to me neither. Seems that you have added delegate to the stream multiple times, or you have multiple streams (which is less probable because you have to change stream's JID, otherwise previous streams will be closed by the server).

Just check that you receive events from the same stream & that you have just one delegate (if you haven't added extra XMPPModules of course).

public func xmppStreamDidAuthenticate(_ sender: XMPPStream) {

        let multicastDelegate = sender.value(forKey: "multicastDelegate") as! GCDMulticastDelegate

        debugPrint("# of delegates \(multicastDelegate.count)")

        debugPrint(sender.debugDescription)

    }



понедельник, 1 ноября 2021 г. в 16:46:27 UTC+3, sirob...@gmail.com:

Demonized Darkness

unread,
Nov 8, 2021, 1:08:32 AM11/8/21
to XMPPFramework

"# of delegates 5"

i get this as a result of count, is it suppose to be just 1 ?

Demonized Darkness

unread,
Nov 8, 2021, 1:11:32 AM11/8/21
to XMPPFramework
update after few minutes it went to 7  and then it stopped increasing, i am not sure where i am doing mistake, can you please guide a bit that what i need to do to handle this issue.

On Tuesday, November 2, 2021 at 12:14:21 PM UTC+5 yakush...@gmail.com wrote:

Demonized Darkness

unread,
Nov 8, 2021, 1:13:12 AM11/8/21
to XMPPFramework

Number of delegates added by me are



1 stream itself

2 reconnect

3 auto ping

4 last activity

Siarhei Brazil

unread,
Nov 9, 2021, 2:50:27 AM11/9/21
to XMPPFramework
Every xmppModule after activation by stream is going to be its delegate. .activate(xmppStream).

Number of delegates shouldn't change. seems that you are activating some modules again.

DidAuthentificate could be called because of reconnect, try to remove modules, move from simple to more complex.  

понедельник, 8 ноября 2021 г. в 09:11:32 UTC+3, demonize...@gmail.com:

Demonized Darkness

unread,
Nov 10, 2021, 12:55:36 AM11/10/21
to XMPPFramework
ok thanks for the assistance, i will debug. thanks again
Reply all
Reply to author
Forward
0 new messages