https://download.csdn.net/download/eidolon_foot/12568768
14. RELIABILITY OpenDDS Developer's Guide(OpenDDS Version 3.14) The RELIABILITY policy applies to the topic, data reader, and data writer entities via the reliability member of their respective QoS structures. Below is the IDL related to the reliability QoS policy: 可靠性策略通过其各自QoS结构的可靠性成员而适用于主题、数据读取器和数据写入器实体。 以下是与可靠性QoS策略相关的IDL: enum ReliabilityQosPolicyKind { BEST_EFFORT_RELIABILITY_QOS, RELIABLE_RELIABILITY_QOS }; struct ReliabilityQosPolicy { ReliabilityQosPolicyKind kind; Duration_t max_blocking_time; }; This policy controls how data readers and writers treat the data samples they process. The “best effort” value ( BEST_EFFORT_RELIABILITY_QOS ) makes no promises as to the reliability of the samples and could be expected to drop samples under some circumstances. The “reliable” value ( RELIABLE_RELIABILITY_QOS ) indicates that the service should eventually deliver all values to eligible data readers. 此策略控制数据读取器和写入器如何处理他们处理的数据样本。 “尽力而为”值(BEST_EFFORT_RELIABILITY_QOS)对样本的可靠性没有任何保证,在某些情况下可能会丢弃样本。 “可靠”值(RELIABLE_RELIABILITY_QOS)表示该服务最终应将所有值传递给合格的数据读取器。 The max_blocking_time member of this policy is used when the history QoS policy is set to “keep all” and the writer is unable to proceed because of resource limits. When this situation occurs and the writer blocks for more than the specified time, then the write fails with a timeout return code. The default for this policy for data readers and topics is “best effort,” while the default value for data writers is “reliable.” 当历史QoS策略设置为“全部保留”并且写入器由于资源限制而无法继续时,将使用此策略的max_blocking_time成员。 如果发生这种情况,并且写入器阻塞的时间超过了指定的时间,则写入将失败,并返回超时返回代码。 数据读取器和主题的此策略的默认值为“尽力而为”,而数据写入器的默认值为“可靠”。 This policy is considered during the creation of associations between data writers and data readers. The value of both sides of the association must be compatible in order for an association to be created. The reliability kind of data writer must be greater than or equal to the value of data reader. 在创建数据写入者和数据读取者之间的关联时会考虑此策略。 关联双方的值必须兼容才能创建关联。 数据写入器的可靠性类型必须大于或等于数据读取器的值。 Data Distribution Service Version 1.4( formal/2015-04-10) This policy indicates the level of reliability requested by a DataReader or offered by a DataWriter . These levels are ordered, BEST_EFFORT being lower than RELIABLE. A DataWriter offering a level is implicitly offering all levels below. 此策略指示DataReader请求或DataWriter提供的可靠性级别。 这些级别是有序的,BEST_EFFORT低于RELIABLE。 提供级别的DataWriter隐式提供下面的所有级别。 The setting of this policy has a dependency on the setting of the RESOURCE_LIMITS policy. In case the RELIABILITY kind is set to RELIABLE the write operation on the DataWriter may block if the modification would cause data to be lost or else cause one of the limits in specified in the RESOURCE_LIMITS to be exceeded. Under these circumstances, the RELIABILITY max_blocking_time configures the maximum duration the write operation may block. 此策略的设置取决于RESOURCE_LIMITS策略的设置。 如果将RELIABILITY类型设置为RELIABLE,则如果修改将导致数据丢失或导致超出RESOURCE_LIMITS中指定的限制之一,则可能会阻止对DataWriter的写操作。 在这些情况下,RELIABILITY max_blocking_time配置写操作可能阻塞的最大持续时间。 If the RELIABILITY kind is set to RELIABLE, data-samples originating from a single DataWriter cannot be made available to the DataReader if there are previous data-samples that have not been received yet due to a communication error. In other words, the service will repair the error and re-transmit data-samples as needed in order to re-construct a correct snapshot of the DataWriter history before it is accessible by the DataReader . 如果将RELIABILITY类型设置为RELIABLE,则由于通讯错误而无法接收到以前的数据样本,则无法使源自单个DataWriter的数据样本对DataReader可用。 换句话说,该服务将修复错误并根据需要重新传输数据样本,以便在DataReader对其进行访问之前重建DataWriter历史记录的正确快照。 If the RELIABILITY kind is set to BEST_EFFORT, the service will not re-transmit missing data-samples. However for data- samples originating from any one DataWriter the service will ensure they are stored in the DataReader history in the same order they originated in the DataWriter . In other words, the DataReader may miss some data-samples but it will never see the value of a data-object change from a newer value to an order value. 如果将RELIABILITY类型设置为BEST_EFFORT,则该服务将不会重新传输丢失的数据样本。 但是,对于源自任何一个DataWriter的数据样本,服务将确保以与源自DataWriter的顺序相同的顺序将它们存储在DataReader历史记录中。 换句话说,DataReader可能会丢失一些数据样本,但它永远不会看到数据对象的值从较新的值更改为订单值。 The value offered is considered compatible with the value requested if and only if the inequality “offered kind >= requested kind ” evaluates to ‘TRUE.’ For the purposes of this inequality, the values of RELIABILITY kind are considered ordered such that BEST_EFFORT < RELIABLE. 当且仅当不等式“提供的种类> =请求的种类”评估为“ TRUE”时,才认为提供的值与请求的值兼容。出于这种不等式的目的,将RELIABILITY类型的值视为有序的,使得BEST_EFFORT <RELIABLE 。