ZBLOG

The TransportInterface defines the following data members: Member Data type Description transport_kind_ int32_t Unique identifier of the transport type. Note transport_kind_ is a protected data member for internal use. It cannot be accesse...

The TransportInterface defines several data members, specifically transport_kind_, which is essential for identifying the type of transport used in Fast DDS (Data Distribution Service). Below is a detailed explanation of the transport_kind_ member and its associated constants:

Data Member: transport_kind_

  • Data Type: int32_t
  • Description: This member serves as a unique identifier for the transport type being utilized. It is protected, meaning it can only be accessed or modified by derived classes within the library and not from external code using the public API.

Importance of transport_kind_

When implementing a custom transport, developers are required to assign this member a unique constant value corresponding to their transport type. This allows the Fast DDS system to recognize and handle various transports appropriately.

Predefined Transport Identifiers

Fast DDS currently uses several predefined identifiers for various transport types, each associated with a specific integer value:

Identifier Value Transport Type
LOCATOR_KIND_RESERVED 0 None. Reserved value for internal use.
LOCATOR_KIND_UDPv4 1 UDP Transport over IPv4.
LOCATOR_KIND_UDPv6 2 UDP Transport over IPv6.
LOCATOR_KIND_TCPv4 4 TCP Transport over IPv4.
LOCATOR_KIND_TCPv6 8 TCP Transport over IPv6.
LOCATOR_KIND_SHM 16 Shared Memory Transport.

Usage Scenario

When developing a new custom transport protocol, you would implement it by:

  1. Subclassing the relevant base class that includes the TransportInterface.
  2. Assigning one of your own unique integer constants to transport_kind_ if you introduce a new transport type or reuse an existing identifier.
  3. Ensuring proper integration with Fast DDS’s framework so that your custom transport can communicate effectively with other components.

Summary

In summary, transport_kind_ is an integral part of Fast DDS’s architecture allowing it to manage different transportation protocols effectively while enabling extensibility through user-defined transports. Each predefined identifier facilitates recognition and differentiation between supported communication methods in distributed systems applications built on Fast DDS technology.


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:http://sdn.0voice.com/?id=7212

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?