loading contacts takes a while (General questions)
when it comes to login, it takes some time to load contacts into the Contacts property. Is there any other option to get a complete list of contacts than to guess how many seconds to wait?
.oXMPP.Blocking = .T.
.oXMPP.Connect(.cServer)
lnCount=.oXMPP.Contacts.Count -> returns 0
.oXMPP.Blocking = .T.
.oXMPP.Connect(.cServer)
lnsec=SECONDS()
DO WHILE (SECONDS()-lnsec)<1 && wait 1 second
ENDDO
lnCount=.oXMPP.Contacts.Count -> returns 12, sometimes 11
(on the server is 12 contacts. what if they will be 100?)
Re: loading contacts takes a while
Hi,
Unfortunately, no. When using Blocking mode, we can't say how much contacts there are before receiving them all.
But is there any specific reason why you're using Blocking mode?
In non-blocking mode we provide ContactList event, which is triggered when complete contacts list is provided by the server.
Regards,
Damba