Unregistered wrote:I have one question about using this IDLE for IMAP thing though: if you do this, and you maintain a constant connection with the IMAP server, does this eat up battery life? Since you now have to keep an open connection with the cell tower. (Sorry if I didn't make this clear, I'm referring to using it on a cellular network, I guess if you keep Wi-Fi on all the time it WOULD drain your battery faster.)
Good question. I would hope that it wouldn't drain battery any faster, though wouldn't be surprised if it did. The radio has to be on anyway, and AFAIK IDLE doesn't actually transmit any data - but I'm not 100% on that. If you configure the email client to check every 5 minutes, then it *does* transmit data and so use more battery life (and money). Note that a 'connection' isn't a physical thing but a logical one - no action is required in order to keep it 'open'.
Of course, if you don't check for email automatically *and* don't use IDLE, then it'll very likely use less battery.
Here's the RFC on it. It has an interesting example session which has 'time passes' where there is no traffic :
"Example: C: A001 SELECT INBOX
S: * FLAGS (Deleted Seen)
S: * 3 EXISTS
S: * 0 RECENT
S: * OK [UIDVALIDITY 1]
S: A001 OK SELECT completed
C: A002 IDLE
S: + idling
...time passes; new mail arrives...
S: * 4 EXISTS
C: DONE
S: A002 OK IDLE terminated
...another client expunges message 2 now...
C: A003 FETCH 4 ALL
S: * 4 FETCH (...)
S: A003 OK FETCH completed
C: A004 IDLE
S: * 2 EXPUNGE
S: * 3 EXISTS
S: + idling
...time passes; another client expunges message 3...
S: * 3 EXPUNGE
S: * 2 EXISTS
...time passes; new mail arrives...
S: * 3 EXISTS
C: DONE
S: A004 OK IDLE terminated
C: A005 FETCH 3 ALL
S: * 3 FETCH (...)
S: A005 OK FETCH completed
C: A006 IDLE
"
It also (as well as Fastmail.fm's help) has a statement advising against having such short polling intervals as 5 minutes :
"The server MAY consider a client inactive if it has an IDLE command
running, and if such a server has an inactivity timeout it MAY log
the client off implicitly at the end of its timeout period. Because
of that, clients using IDLE are advised to terminate the IDLE and
re-issue it at least every 29 minutes to avoid being logged off.
This still allows a client to receive immediate mailbox updates even
though it need only "poll" at half hour intervals.
"
but it seems like it still assumes that the client has reliable and constant connectivity, which isn't the case with a mobile phone. I don't know enough about the network stack to know what parts of it can change without affecting applications using parts higher up the stack.
I'd repeat what I said earlier, that you should set the polling period to be the maximum you can live with, depending on how often your phone becomes disconnected from the internet. If your phone can keep a reliable connection, then 28 minutes is more advisable - less load on the IMAP server, less data transmission so lower cost for you and longer battery life.
It would be interesting to know what can cause a disconnect while in IDLE.
I would imagine a change in IP address would cause a disconnect.
This can happen if your IP address is dynamic (assigned by DHCP), which is the case for a lot of DSL connection, but I also imagine that all phones are set to DHCP too. It might be that it is only dependant on the public interface's IP address, which might not change if you're ISP is assigning private addresses.
I don't know what happens when your cell phone switches from tower to tower, but I hope that it would just be at the physical level and not involve any IP address changes.
If you lose touch with towers completely, that might be another issue. If you have your email client set to poll every 5 minutes, then when it fails to connect, it might well time out, resulting in the client disabling the polling (which I think Nokia's Messaging app does) and you not getting notified of any new messages until you enable it again.
If you have the polling set to longer, then perhaps it would give the physical layer longer to recover, and you can go for longer without a connection and still maintain IDLE at no cost since there's no IP traffic.
Yes, I think this is an important point - for people who use Nokia's Messaging client at least. Polling at a high frequency might be something you definitely don't want to do.
I would appreciate input from an expert on this issue. Steve, do you know of anyone?