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消息中都是可选的。
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. 成功的 successfulThe 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. 订阅 subscriptionThe 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. 错误 errorThe 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
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扩展字段已经不推荐使用。
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.