Mark Crispin wrote:
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?
Not everybody has a fast 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.
I'm not sure why I didn't think of using message numbers instead of UIDs. Duh!
I'll be using that.
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).
It's the perception that to the end user that the product is downloading the messages instead of
having the user think the application isn't doing anything for several minutes. I'll be playing
around what the number would be for getting the uids in a batch.
-- 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