A program that initiates communications. A HTTP client is a client that initiates TCP/IP connections for the purpose of sending HTTP requests. A Bayeux client initiates the Bayeux message exchange and will typically execute within a HTTP client, but it is likely to have Bayeux clients that execute within HTTP servers. Implementations may distinguish between Bayeux clients running within a HTTP client and Bayeux clients running within the HTTP server. Specifically server-side Bayeux clients MAY be privileged clients with access to private information about other clients (e.g. client IDs) and subscriptions.
客户端
初始化通信的程序。初始化TCP/IP连接以发送HTTP请求的HTTP客户端就是一个客户端。一个Bayeux客户端初始化Bayeux消息交换,并且通常会在HTTP客户端中执行,但是也可能在HTTP服务端中执行。运行于HTTP客户端的Bayeux客户端和运行于HTTP服务端中的Bayxue客户端,实现会有区别。具体来说,服务器端的Bayeux客户端可能更优先的访问其他客户端的私有信息(比如它们的client ID)和订阅。
服务端
An application program that accepts communications from clients. A HTTP server accepts TCP/IP connections in order to service HTTP requests by sending back HTTP responses. A Bayeux server accepts and responds to the message exchanges initiated by a Bayeux client.
服务端
接受来自客户端通信的应用程序。一个HTTP服务器接受TCP/IP连接,通过返回HTTP响应来服务HTTP请求。一个Bayeux服务端接受和响应由Bayeux客户端发起的消息交换。
request
An HTTP request message as defined by section 5 of RFC 2616
请求
RFC2616 第5章节所定义的HTTP请求消息
response
A HTTP response message as defined by section 6 of RFC 2616
响应
RFC2616 第6章节所定义的HTTP响应消息
message
A message is a JSON object exchanged between client and server for the purposed of implementing the Bayeux protocol as defined by sections 3, 4 and 5.
消息
一个消息是客户端和服务端交互的一个JSON对象,目的就是为了实现3、4、5章节中所定义的Bayeux协议。
event
Application specific data that is sent over the Bayeux protocol
事件
通过Bayeux协议所发送的应用相关的数据
envelope
The transport specific message formate that wraps a standard Bayeux message.
信封
用来封装标准Bayeux消息所传输的特定消息格式
The HTTP protocol is a request/response protocol. A client sends a request to the server in the form of a request method, URI, and protocol version, followed by a MIME-like message containing request modifiers, client information, and optional body content over a connection with a server. The server responds with a status line, including the message's protocol version and a success or error code, followed by a MIME-like message containing server information, entity metainformation, and possible entity-body content.
HTTP是个请求/响应协议。客户端发送请求到服务端是基于一个到服务端的连接,所使用格式为请求方法,URI,协议版本,紧接着是包含请求描述符的一个类似MIME的消息,客户端信息,和可选的内容体。服务端用一个状态行来响应,包括消息的协议版本和一个成功或错误码,紧接着是包含服务端信息的类似MIME的消息,实体元信息,和可能的实体内容体。
The server may not initiate a connection with a client nor send an unrequested response to the client, thus asynchronous events cannot be delivered from server to client unless a previously issued request exists. In order to allow two way asynchronous communication, Bayeux supports the use of multiple HTTP connections between a client and server, so that previously issued requests are available to transport server to client messages.
服务器不会初始化一个到客户端的连接,也不会发送一个未请求的响应到客户端,因此异步事件不能从服务端分发到客户端,除非一个之前相关的连接已存在。为允许两路异步通信,Bayeux支持一个客户端和服务端间多HTTP连接的使用,因此之前相关的请求可用来传输服务端至客户端的消息。
The recommendation of section 8.1.4 of RFC 2616 is that a single user client SHOULD NOT maintain more than 2 connection with any server, thus the Bayeux protocol MUST NOT require any more than two HTTP requests to be simultaneously handled by a server in order to handle all application (Bayeux based or otherwise) running within a client.