GMAIL API - Quickest method to check for new Mail [closed]

白昼怎懂夜的黑 提交于 2019-12-12 05:39:29

问题


I'm getting some offers by emails. And there is a competition who get it first. They send an email with a verification code inside.

Which solution is best to check for new gmail messages and get new message body ASAP?

I heard about

  • IMAP IDLE.. is that quick enough?
  • POP3 is it better to check for new messages via POP3 continuously?

回答1:


The fastest method would be IMAP clearly

it allows a client to indicate to the server that it is ready to accept real-time notifications. The basic network use of the IDLE command is very small, and so it makes very efficient use of bandwidth

A good IMAP server will have minimal overhead for an Idle connection, and it support 10’s or 100’s of thousands of connections.

Another practical problem is that current phone networking technology will lose IP network connectivity from time to time, and this will need to be automatically re-established, and the

IMAP connection re-established if this is lost due to a long network failure.




回答2:


If you authentication is open, maybe a simple Web request is fastest of all.




回答3:


Note, that there is still a large delay between when that email is sent, and in how that email is processed by any number of intermediate servers before it's ultimately in an IMAP/POP account ready for access by the client.

Are you sure you're optimising the correct problem?



来源:https://stackoverflow.com/questions/13715820/gmail-api-quickest-method-to-check-for-new-mail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!