简体   繁体   English

ZeroMQ vs socket.io

[英]ZeroMQ vs socket.io

I want major difference between ZeroMQ and socket.io 我想要ZeroMQ和socket.io之间的主要区别

  1. Performance . 表现 ( Is it faster? Scalable? ) (它更快吗?可扩展?)
  2. Applications . 应用 ( Is it used for real time services? ) (它用于实时服务吗?)
  3. Browsers Support . 浏览器支持 ( Which browsers are supported? ) (支持哪些浏览器?)

Although there are some situations where the two might be used interchangeably, you're comparing apples and oranges. 虽然在某些情况下两者可以互换使用,但你要比较苹果和橘子。

Socket.io Socket.io
is a javascript library, composed of two parts- a client-side part meant to run in any browser that supports Web sockets, and a server-side part which runs on NodeJS. 是一个javascript库,由两部分组成 - 一个客户端部分,用于在任何支持Web套接字的浏览器中运行,以及一个在NodeJS上运行的服务器端部分。 It's used to build real-time web applications, meaning you're expecting a lot of back and fourth communication between the client and server (and possibly multiple clients- eg. chat). 它用于构建实时Web应用程序,这意味着您期望在客户端和服务器之间进行大量的后台和第四次通信(可能还有多个客户端 - 例如聊天)。

ZeroMQ ZeroMQ
is a networking library, used to build distributed applications. 是一个网络库,用于构建分布式应用程序。 It's meant to run on the backend. 它意味着在后端运行。 The idea is to enable communication between any combination of different threads or processes, be it on a single machine or a distributed network (which means it uses different transport means for different purposes- and it does so seamlessly). 这个想法是在不同线程或进程的任何组合之间进行通信,无论是在单个机器上还是在分布式网络上(这意味着它使用不同的传输方式用于不同的目的 - 并且它无缝地这样做)。 There are usage examples plenty of popular programming languages (PHP, Python, C++, C#, CL, Delphi, Erlang, F#, Felix, Haskell, Java, Objective-C, Ruby, Ada, Basic, Clojure, Go, Haxe, Node.js, ooc, Perl, and Scala), so it is not tied to NodeJS, or any server framework for that matter. 有许多流行的编程语言(PHP,Python,C ++,C#,CL,Delphi,Erlang,F#,Felix,Haskell,Java,Objective-C,Ruby,Ada,Basic,Clojure,Go,Haxe,Node)。 js,ooc,Perl和Scala),因此它与NodeJS或任何服务器框架无关。

You should read the first couple of pages of the respective docs: 您应该阅读相应文档的前几页:
socket.io socket.io
ZeroMQ guide ZeroMQ指南

In short: 简而言之:
ZeroMQ doesn't run inside a browser, and isn't necessarily tied to NodeJS or JavaScript- it facilitates communication between different "programs". ZeroMQ不在浏览器中运行,并且不一定与NodeJS或JavaScript相关联 - 它促进了不同“程序”之间的通信。 Socket.io is written in JS, is a browser script and an npm package used when you want real time communication between NodeJS server and the client. Socket.io是用JS编写的,是一个浏览器脚本和一个npm包,当你想要在NodeJS服务器和客户端之间进行实时通信时使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM