engine.io与socket.io有什么不同? [英] How is engine.io different from socket.io?

查看:534
本文介绍了engine.io与socket.io有什么不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

LearnBoost似乎有一个名为 engine.io 的新项目,理论上似乎相似到socket.io。 1)在什么情况下你会使用一个与另一个?
2)对于需要通过node.js进行基于HTML5套接字通信的新项目,我们应该使用engine.io而不是socket.io吗?

LearnBoost seems to have a new project called engine.io that in theory seems to be similar to socket.io. 1) Under what scenarios would you use one versus the other? 2) For new projects that require HTML5 sockets based communication over node.js, should we use engine.io and NOT socket.io?

推荐答案

来自 https://github.com/LearnBoost/engine.io


Engine的主要目标是确保最可靠实时沟通。与之前的socket.io核心不同,它始终首先建立长轮询连接,然后尝试升级到旁边经过测试的更好的传输。

The main goal of Engine is ensuring the most reliable realtime communication. Unlike the previous socket.io core, it always establishes a long-polling connection first, then tries to upgrade to better transports that are "tested" on the side.

期间在socket.io项目的生命周期中,我们发现依赖HTML5 WebSocket或Flash Socket作为第一种连接机制存在无数的弊端。

During the lifetime of the socket.io projects, we've found countless drawbacks to relying on HTML5 WebSocket or Flash Socket as the first connection mechanisms.

两者显然都是正确的方式建立双向通信,HTML5 WebSocket是未来的方式。但是,为了满足大多数业务需求,替代传统的HTTP 1.1机制与提供相同的解决方案一样好。

Both are clearly the right way of establishing a bidirectional communication, with HTML5 WebSocket being the way of the future. However, to answer most business needs, alternative traditional HTTP 1.1 mechanisms are just as good as delivering the same solution.

这篇关于engine.io与socket.io有什么不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆