首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Linux中的TIPC套接字类型

Linux中的TIPC套接字类型
EN

Stack Overflow用户
提问于 2013-04-10 20:18:54
回答 1查看 373关注 0票数 0

在Linux中使用TIPC socket时,我应该在什么时候使用TIPC_ADDR_ID,TIPC_ADDR_NAME,TIPC_ADDR_NAMESEQ。谁能说出它们之间的不同之处?每个地址的好处是什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-04-10 20:27:33

在这个补丁中添加的评论中似乎已经相当清楚地解释了这一点:http://blitiri.com.ar/git/r/pytipc/c/15cae2455c1774400949069e98b3abf5ea20e311/

即:

代码语言:javascript
复制
+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.
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15925618

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档