loading contacts takes a while - WeOnlyDo Discussion board

loading contacts takes a while (General questions)

by yonko, Wednesday, November 09, 2011, 09:16 (4762 days ago)

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

by wodDamir, Wednesday, November 09, 2011, 09:31 (4762 days ago) @ yonko

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