How does CI3 Implement Message push on the server?

Source: Internet
Author: User
Tags codeigniter
Recently, the project needs to synchronize messages from the server to the mobile end. What is the best solution? I first came up with two solutions: the first one: ajax round-robin (obviously not a good method, because the server message is an unknown message. If the round-robin is always maintained, even if... recently, the project needs to synchronize messages from the server to the mobile end. What is the best solution? I first came up with two solutions:

First: ajax round-robin (obviously not a good method, because the server message is unknown. If the round-robin is maintained, even if the interval is several seconds, the mobile end does not end the round-robin operation, just like an infinite loop without terminating the operation)

Type 2: Use websocket to establish a persistent connection where the business needs to be updated in real time. google has a lot of information and many people on the internet suggest using Ratchet. The problem is, has anyone used this tool library? What are their similarities and differences with domestic workman ?? How to select these two tools...

By the way, the important thing is that the project is developed based on CI3, so the compatibility with ci3.

The following are some of my key information:
Http://stackoverflow.com/questions/34389...
Http://socketo.me/
Http://forum.codeigniter.com/thread-6340...

Reply: Recently, the project needs to synchronize messages from the server to the mobile end. What is the best solution? I first came up with two solutions:

First: ajax round-robin (obviously not a good method, because the server message is unknown. If the round-robin is maintained, even if the interval is several seconds, the mobile end does not end the round-robin operation, just like an infinite loop without terminating the operation)

Type 2: Use websocket to establish a persistent connection where the business needs to be updated in real time. google has a lot of information and many people on the internet suggest using Ratchet. The problem is, has anyone used this tool library? What are their similarities and differences with domestic workman ?? How to select these two tools...

By the way, the important thing is that the project is developed based on CI3, so the compatibility with ci3.

The following are some of my key information:
Http://stackoverflow.com/questions/34389...
Http://socketo.me/
Http://forum.codeigniter.com/thread-6340...

Real-time two-way communication must use Websocket, but I do not recommend using PHP as the websocket server. We recommend using nodejs
In addition, if it is only for server push, the browser can use EventSource, which is also an HTML5 standard.

Server MessageSynchronizationTo Mobile End

Two-way synchronization is required, which is not shown in your description.

Try third-party push, such as push and JPush.

For bidirectional access, you can use websocket.

Why not consider asynchronous push? The server pushes new messages to the mobile device, and the mobile device receives the message interface.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.