Comet & PHP: How to use Comet with a PHP Chat System?

后端 未结 3 856
时光说笑
时光说笑 2020-12-08 17:11

I have to build a simple chat system in PHP using Comet.

I don\'t know what would be the best approach to this project.

What is the best technique

相关标签:
3条回答
  • 2020-12-08 17:36

    php is not a good match for comet, because there is no way to have light weight request handlers. You would have to lock up a full process for each user connected. It could work with very few users, but not for anything with even moderate traffic.

    0 讨论(0)
  • 2020-12-08 18:01

    You may want to look at WebChat2 This project uses comet, AJAX, and a custom HTTP server to communicate with IRC via sockets.

    0 讨论(0)
  • 2020-12-08 18:01

    chart & Long point-by-point discussion

    Unfortunately, there's no information for PHP in there, though you could potentially wrap your existing back-end with a comet server on some other platform.

    There is a similar SO question about this, looks like FastCGI is your best bet.

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