nanomsg-Q&A
nn_shutdown vs nn_close
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); |
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.