On Thu, 19 Feb 2009, Shawn Walker wrote:
I have a situation that I need to get a list of UIDs in a range but I have no
idea how many UIDs is
in that range. I can't just request all of the UIDs in a range since there
might be thousands of UIDs and I can't give the impression that the
application isn't doing anything while I wait for the UIDs to be retrieved.
Sheesh, how slow is the link?
Suppose there are 10,000 UIDs, and they're all 5-digits. So that's 60,000
bytes. The link would have to be pretty slow for that to be noticable.
In many cases, the RTT will take more time!
Anyway, if you want to fetch 25 UIDs at a time, that is pretty simple.
Translate the two UIDs to sequence numbers using mail_msgno(). That now
gives you a pair of msgnos. It's now a simple exercise to pass msgnos for
a range of 25 a time to a SEARCHPGM that you then repeatedly call
mail_search_full() as needed.
Personally, I think that 25 UIDs at a time will be FAR slower than the big
fetch; the RTT times will kill you. If you need to split it up due to low
bandwidth, you ought to do something more like 1000 at a time (and even
then the RTT cost may be excessive).
-- Mark --
http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
_______________________________________________
Imap-uw mailing list
[email protected]
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw