Exemplo n.º 1
0
        /// <summary>
        /// Sets the <see cref="Subscriber" /> QoS policies.
        /// </summary>
        /// <param name="qos">The <see cref="SubscriberQos" /> to be set.</param>
        /// <returns>The <see cref="ReturnCode" /> that indicates the operation result.</returns>
        public ReturnCode SetQos(SubscriberQos qos)
        {
            if (qos == null)
            {
                return(ReturnCode.BadParameter);
            }

            var qosNative = qos.ToNative();

            var ret = UnsafeNativeMethods.SetQos(_native, qosNative);

            qos.Release();

            return(ret);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the <see cref="Subscriber" /> QoS policies.
        /// </summary>
        /// <param name="qos">The <see cref="SubscriberQos" /> to be filled up.</param>
        /// <returns>The <see cref="ReturnCode" /> that indicates the operation result.</returns>
        public ReturnCode GetQos(SubscriberQos qos)
        {
            if (qos == null)
            {
                return(ReturnCode.BadParameter);
            }

            SubscriberQosWrapper qosWrapper = default;
            var ret = UnsafeNativeMethods.GetQos(_native, ref qosWrapper);

            if (ret == ReturnCode.Ok)
            {
                qos.FromNative(qosWrapper);
            }

            qos.Release();

            return(ret);
        }