Linux中的TIPC套接字类型
在Linux中使用TIPC套接字时,何时应使用TIPC_ADDR_ID、TIPC_ADDR_NAME、TIPC_ADDR_NAMESEQ。 有人能说出他们之间的区别吗?Linux中的TIPC套接字类型,linux,sockets,tipc,Linux,Sockets,Tipc,在Linux中使用TIPC套接字时,何时应使用TIPC_ADDR_ID、TIPC_ADDR_NAME、TIPC_ADDR_NAMESEQ。 有人能说出他们之间的区别吗? 每个地址的好处是什么?在本补丁中添加的一条评论中似乎解释得相当清楚: 即: +Addresses are expressed as (addr_type, v1, v2, v3 [, scope]); +where addr_type can be one of: + TIPC_ADDR_NAMESEQ, TIPC_ADDR
每个地址的好处是什么?在本补丁中添加的一条评论中似乎解释得相当清楚: 即:
+Addresses are expressed as (addr_type, v1, v2, v3 [, scope]);
+where addr_type can be one of:
+ TIPC_ADDR_NAMESEQ, TIPC_ADDR_MCAST, TIPC_ADDR_NAME, and TIPC_ADDR_ID;
+and scope can be one of:
+ TIPC_ZONE_SCOPE, TIPC_CLUSTER_SCOPE, and TIPC_NODE_SCOPE.
+
+
+The meaning of v1, v2 and v3 depend on the value of addr_type:
+
+ if addr_type is TIPC_ADDR_NAME:
+ v1 is the server type
+ v2 is the port identifier
+ v3 is ignored
+ if addr_type is TIPC_ADDR_NAMESEQ or TIPC_ADDR_MCAST:
+ v1 is the server type
+ v2 is the lower port number
+ v3 is the upper port number
+ if addr_type is TIPC_ADDR_ID:
+ v1 is the node
+ v2 is the ref
+ v3 is ignored
+
+Even when ignored, v3 must be present and be an integer.