android - How Messages are Received on WhatsApp or any other messaging service? -


can please tell me how whatsapp messages received on mobile? like, phone requests whatsapp serve every second or server send phone ping when message me received @ server end. don't want know exact procedure, overview job.

well guess, not easy answer in scope here how might work.

for may need understanding of technology on mobile side , server side.so let me try explain in simple manner may implementation.

1) no, mobile not ping server everytime. polling adds lots of overhead on network, multiple calls can stacked if there delay in responding leading huge traffic on server side. instead , other way round. whenever server recieves msg pings instead recieved msg.

2) hope point 1 makes clear other way around. know push notification. push notification whichserver can notify mobile of new msgs or information or update.here's link can give more detail on push notification android https://parse.com/tutorials/android-push-notifications

3)how server processes request. big topic. goes this.i assume there 2 users, , b

  • first mr send msg mr b
  • server recieves request information of user a(i.e person sent msg) , user b(i.e person whom sg sent)
  • the server processing know user id of mr b , other infomation mr b , push user b can recieve notification.

of course lot of technology involved job in order handle millions of concurrent connections , responding fast without blocking other connections.

if want have basic view of technology, suggest @ socket io , node js. heres chat example http://socket.io/get-started/chat/

hope helps


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -