我需要以下要求:
>尽量减少延迟
>全双工
>最小标头数据长度
两者都满足这个要求吗?哪个更好?
解决方法
Channel messaging is particularly useful for communication across
multiple origins. Consider the following scenario. We have a document
at 07002 containing content from
07003 embedded in one iframe,and content from
07004 in another.Now let’s say that we want to
send a message from our address book site to our games site. We Could
use the social site as a proxy. That,however,means the address book
gains the same level of trust as the social site. Our social site
either has to trust every request,or filter them for us.With channel
messaging,07004 and
07003 can communicate directly.
Web Sockets API可用于在浏览器中加载的代码与服务器之间进行通信.所以它有一个完全不同的目的.由于您提到了低延迟和“全双工”的要求,我假设您的意思是客户端 – 服务器通信,因此您正在寻找Web套接字.