How does Gmail do comet on Opera?

前端 未结 4 465
轻奢々
轻奢々 2021-02-02 02:33

I would like to know how Gmail (or anyone else) does comet on Opera.

Here is what I know so far from my experiments.

  1. It doesn\'t use the event-source tag w
相关标签:
4条回答
  • 2021-02-02 02:44

    GMail uses BrowserChannel (Docs | Source), which is included in Google's Closure Library.

    • @fileoverview Definition of the BrowserChannel class. A BrowserChannel
    • simulates a bidirectional socket over HTTP. It is the basis of the
    • Gmail Chat IM connections to the server.
    0 讨论(0)
  • 2021-02-02 02:45

    I am the author of an in progess C++ HTTP server that is compatible with goog.netBrowserChannel. You can find the docs I've written while studying the protocol here:

    http://code.google.com/p/libevent-browserchannel-server/wiki/BrowserChannelProtocol

    Long story short, BrowserChannel uses forever frames on IE and XHR streaming on all other browsers. The protocol is divided into several phases, the first of which is network testing:

    1) test the network to ensure response "streaming" is supported (in other words no buffering proxy exists)
    2) check access to a variety of network prefixes (to make sure the network admin has not blocked access to chat)

    Then the actual data transmission can start. Data is divided into two channels (forward and back). The back channel is a series of long lived (about 4 mins each) requests used for the server to "stream" content to the client. To do so HTTP chunked encoding is used. The client does it's best to make sure that one backchannel is always open. The server will close it about every 4 mins after which the client will open a new backchannel. The forward channel is used to send data from the client to the server. This pushing of data is done as necessary.

    0 讨论(0)
  • 2021-02-02 02:55

    I think that rather cross-browser (including Opera) approach might be to stream data through an Adobe Flash application. Though it would introduce dependence on the Flash plugin and is not very popular because of that.

    0 讨论(0)
  • 2021-02-02 03:04

    I really don't have any idea on what the answer is. But I know Opera supports server-events : http://my.opera.com/WebApplications/blog/show.dml/438711 . Maybe it's a step towards the anwser? I'm not really sure either, but I think they use it within Opera Unite.

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