1

我需要建立一种即时通讯系统。根据我的简短探索,ZeroMQ 和 nanomsg 的目标是后端分布式系统中的服务器-服务器通信,而不是同时管理 +100K 的最终用户客户端连接。那准确吗?如果是这样,C 中是否有一个很好的消息传递库,可以很好地适应客户端数量?消息将是服务器->客户端推送和客户端->服务器请求/响应的混合。

4

2 回答 2

1

nanomsg 库不是面向服务器的协议。它有一些独特的沟通贴片,涵盖了广泛的沟通需求。请参阅:nanomsg 通信模式

nanomsg 库非常易于使用 -nn_bind并且nn_connect可以在同一个套接字上多次调用,从而允许套接字与多个异构端点进行通信。

我对 nanomsg 的偏好优于 ZeroMQ 是基于 article1 article2 我自己的编码经验。还可以看看这里给出的非常好的比较:在 BSD 或 MIT 许可下发布的 ZeroMQ 是否有任何 Python 2.7 替代品?

实际上,nanomsg 库使网络层快速、可扩展且易于使用。

于 2017-12-03T03:08:14.440 回答
0

You will have a problem when you want to use a tcp/ip library to allow 100k simultaneous end user clients, staying alive, as you system will run out of ports to connect all those clients. It seems that both ZeroMQ and nanomsg address this problem. On the first glimpse I would say nanomsg is the better approach. But I would need to try that first.

Nanomsg seems actually designed to address exactly your problem.

于 2015-07-06T17:22:23.353 回答