nn_shutdown closes just one endpoint and prevents that endpoint from forming new connections.
nn_close closes the entire socket.
A socket can have many endpoints.
多个服务端支持多个客户端 nn_device
a single socket can be connected to multiple endpoints at the same time.
device framework
s = nn_socket(AF_SP_RAW, NN_REQ); nn_bind(s, "tcp://server1:5556"); nn_bind(s, "tcp://server2:5556"); nn_bind(s, "tcp://server3:5556");
This means you get three underlying TCP connections load balanced by a single outgoing REQ socket. You can use that with a device framework to get the DEALER logic you're trying to achieve.
You can even omit it to listen on all interfaces - e.g. tcp://:5556 will cause the server to listen on every network interface on TCP port 5556.
通过一系列步骤传递任务的的协议,这个协议是可扩展的(官方原文:scalability protocol for passing tasks through a series of processing steps.);它可以公平的对来自先前的处理步骤的消息进行排队,并在下一个处理步骤的实例中对它进行负载均衡;关键字,NN_PUSH,NN_PULL。