Server push: comet vs ape?

后端 未结 8 1003
难免孤独
难免孤独 2021-02-15 16:24

I\'ve read a little about comet and also APE.

Which one is better? I want the users to see other users updated content. Like Google Wave.

And in comet, there are

相关标签:
8条回答
  • 2021-02-15 16:52

    Isn't APE just an implementation of Comet? That's what is says on the product page.

    0 讨论(0)
  • 2021-02-15 16:56

    Comet is a set of techniques useful for developing realtime applications. You have two main implementations: streaming and long polling.

    In regular http requests the user sends the request to the server, receives the data (html, scrips, etc) and closes the connection - end of story. In streaming the connection is never closed by the client or the server, there's a single connection shared by both parties.

    In long polling, you have a recurring connection that waits for a response. Basically, the browser sends a request to the server and sits there waiting until the server responds (the server only responds when he has new data for the client), then the connection is closed and it's up to the browser to reopen a connection, and the cycle repeats :) Of the two, this is the most used.

    Comet in the browser typically requires a web server optimized for large numbers of long-lived HTTP connections, and a JavaScript client to communicate with the Comet server. So Ape is an installable server and Comet is the paradigm on which it is based. Here you have a list of comet implementations: http://cometdaily.com/maturity.html

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