PHP : Best way to push data from server to clients…?

前端 未结 3 1308
遥遥无期
遥遥无期 2020-12-09 06:01

In my project I need to push some data from server to the client like facebook does, when some updates are performed in the clients profile

相关标签:
3条回答
  • 2020-12-09 06:15

    what you need is a comet/websocket approach, i do not know any PHP comet implementations/frameworks, yet there are several examples on the web when you search for it.

    0 讨论(0)
  • 2020-12-09 06:24

    you can use node.js: http://nodejs.org/

    0 讨论(0)
  • 2020-12-09 06:27

    You should take a look at the APE Project, which supports multiple variations that are as close to Push as you will get, like long-polling, XHRStreaming and WebSockets.

    • http://www.ape-project.org/
    • http://www.ape-project.org/wiki/index.php/Tutorial:Use_different_transport_method_(JSONP,_XHRStreaming)#Long_Polling

    edit Doing this in just PHP is not the best choice, as it takes up a lot of resources to keep all those connections alive.

    0 讨论(0)
提交回复
热议问题