HTML5技术

Bayeux协议 - 亮0000仔(9)

字号+ 作者:H5之家 来源:H5之家 2015-12-07 17:06 我要评论( )

YYYY-MM-DDThh:mm:ss.ss A timestamp message field is OPTIONAL in all Bayeux messages. 时间戳消息字段应该指定为下面的ISO8601格式:所有时间应该用GMT时间发送。 YYYY-MM-DDThh:mm:ss.ss 时间戳消息字段在任何

YYYY-MM-DDThh:mm:ss.ss
A timestamp message field is OPTIONAL in all Bayeux messages.
时间戳消息字段应该指定为下面的ISO8601格式:所有时间应该用GMT时间发送。
YYYY-MM-DDThh:mm:ss.ss
时间戳消息字段在任何Bayeux消息中都是可选的。

3.10. 数据 data

The data message field is an arbitrary JSON object that contains event information. The data field MUST be included in publish requests, and a Bayeux server MUST include the data field in an event delivery message.

数据消息字段是一个包含时间信息的任意的JSON对象。数据字段必须包含在publish请求中,并且Bayeux服务端也必须在时间发送消息中包含数据字段。

 

3.11. 连接Id connectionId

The connectionId field was used during development of the Bayeux protocol and its use is now deprecated. 

连接Id字段在Bayeux开发阶段使用,现在已经不推荐使用。

3.12. 成功的 successful

The successful boolean message field is used to indicate success or failure and MUST be included in responses to the "/meta/handshake", "/meta/connect", "/meta/subscribe","/meta/unsubscribe", "/meta/disconnect", and publish channels.

成功布尔消息字段用来表明成功或失败,必须包含在到"/meta/handshake", "/meta/connect", "/meta/subscribe","/meta/unsubscribe", "/meta/disconnect", 和publish通道消息的响应中。

3.13. 订阅 subscription

The subscription message field specific the channels the client wishes to subscribe to or unsubscribe from. The subscription message field MUST be included in requests and responses to/from the "/meta/subscribe" or "/meta/unsubscribe" channels. 

订阅消息字段明确了客户端想订阅的和接触订阅的通道。订阅消息字段必须包含在"/meta/subscribe"通道的请求中,或者"/meta/unsubscribe"通道的响应中。

3.14. 错误 error

The error message field is OPTIONAL on any Bayeux response. The error message field MAY indicate the type of error that occurred when a request returns with a false successful message. The error message field should be sent as a string in the following format:

error = error_code ":" error_args ":" error_message 
| error_code ":" ":" error_message
error_code = digit digit digit
error_args = string *( "," string )
error_message = string

Example error strings are:

401::No client ID
402:xj3sjdsjdsjad:Unknown Client ID
403:xj3sjdsjdsjad,/foo/bar:Subscription denied
404:/foo/bar:Unknown Channel
Need to provide list of codes
错误消息字段在任何Bayeux响应中都是可选的。当一个请求返回不成功消息时,错误消息字段可以表明发生的错误类型。错误消息字段应该按照以下格式的字符串被发送:
error = error_code ":" error_args ":" error_message 
| error_code ":" ":" error_message
error_code = digit digit digit
error_args = string *( "," string )
error_message = string

Example error strings are:

401::No client ID
402:xj3sjdsjdsjad:Unknown Client ID
403:xj3sjdsjdsjad,/foo/bar:Subscription denied
404:/foo/bar:Unknown Channel
Need to provide list of codes

3.15. 扩展 ext

An ext field MAY be included in any Bayeux message. Its value SHOULD be a JSON map with top level names distinguished by implementation names (eg. "org.dojo.Bayeux.field").

The contents of ext may be arbitrary values that allow extensions to be negotiated and implemented between server and client implementations.

扩展字段可以包含在任何Bayeux消息中,它的值应该是以实现名称显著显示的顶级名称(如:"org.dojo.Bayeux.field")的JSON map。扩展内容可以是任意值,这些值允许扩展被协商和实现在服务端和客户端实现之间。

3.16. json-comment-filtered

The json-comment-filtered ext field of the handshake message is deprecated.
握手消息的json-comment-filtered扩展字段已经不推荐使用。

4. Meta消息定义 Meta Message Definitions 4.1. 握手 handshake 4.1.1. 握手请求 handshake Request

A Bayeux client initiates a connection negotiation by sending a message to the "/meta/handshake" channel. For same domain connections, the Handshake requests MUST be sent to the server as the 'message' parameter of an application/x-www-form-urlencoded encoded POST request. For cross domain connections, the Handshake request MUST be sent to the server as a url encoded GET request with the jsonp parameter set for callback-polling.

 

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • HTTP协议学习随笔 - 糖醋酸辣椒

    HTTP协议学习随笔 - 糖醋酸辣椒

    2017-05-01 18:03

  • 计算机网络——DNS协议的学习与实现 - 学数学的程序猿

    计算机网络——DNS协议的学习与实现 - 学数学的程序猿

    2017-04-16 10:00

  • 跨平台的.NET邮件协议MailKit组件解析 - 彭泽0902

    跨平台的.NET邮件协议MailKit组件解析 - 彭泽0902

    2017-03-17 13:01

  • TCP/IP协议族(一) HTTP简介、请求方法与响应状态码 - 青玉伏案

    TCP/IP协议族(一) HTTP简介、请求方法与响应状态码 - 青玉伏案

    2017-02-03 11:02

网友点评
m