`
seasons
  • 浏览: 109783 次
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

Bayeux中的multi-frame的行为

 
阅读更多

一般来说一个client对server只有2个connect.一个收一个发.
如果开2个tab的情况, 则让2个tab各保持一个连接.
对于server端来说是这样的,根据cookie来判断是否multiframe,
如果发现是multiframe, 则改用传统的polling,就是每收到client的connect请求,就给一个response,里面带着advice有建议的interval.这样client就可以定期发送connect给server

如果不是multiframe,则server端收到connect后,会一直等到有event message才返回响应,
如果是, 则server会在收到connect后马上返回response,同时带上event message.


NO MULTIFRAME
/*[{"channel": "/meta/handshake", "version": "1.0", "supportedConnectionTypes": ["long-polling"], "clientId"
: "wFOjF72neFUoNhT", "successful": "true", "minimumVersion": "0.1", "authSuccessful": true, "advice": {"interval": 0, "multiple-clients": false}}]*/

/*[{"channel": "/meta/connect", "successful": "true", "clientId": "wFOjF72neFUoNhT", "error": "", "timestamp"
: "2007-12-04 08:38:17.641", "connectionId": "null", "advice": {"interval": 0, "multiple-clients": false}}]*/

MULTIFRAME
/*[{"channel": "/meta/handshake", "version": "1.0", "supportedConnectionTypes": ["long-polling"], "clientId"
: "IlfqaNmHSsyByxT", "successful": "true", "minimumVersion": "0.1", "authSuccessful": true, "advice": {"interval": 0, "multiple-clients": false}}]*/

/*[{"channel": "/meta/connect", "successful": "true", "clientId": "IlfqaNmHSsyByxT", "error": "", "timestamp"
: "2007-12-04 08:41:18.138", "connectionId": "null", "advice": {"interval": 3000, "multiple-clients": true}}]*/

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics