/// <summary>
        /// Sends a ChannelDataFrameSet message to a customer.
        /// </summary>
        /// <param name="channelIds">The channel ids.</param>
        /// <param name="dataFrames">The data frames.</param>
        /// <returns>The message identifier.</returns>
        public virtual long ChannelDataFrameSet(IList <long> channelIds, IList <DataFrame> dataFrames)
        {
            var header = CreateMessageHeader(Protocols.ChannelDataFrame, MessageTypes.ChannelDataFrame.ChannelDataFrameSet);

            var channelDataFrameSet = new ChannelDataFrameSet()
            {
                Channels = channelIds,
                Data     = dataFrames
            };

            return(Session.SendMessage(header, channelDataFrameSet));
        }
 /// <summary>
 /// Handles the ChannelDataFrameSet message from a producer.
 /// </summary>
 /// <param name="header">The message header.</param>
 /// <param name="channelDataFrameSet">The ChannelDataFrameSet message.</param>
 protected virtual void HandleChannelDataFrameSet(IMessageHeader header, ChannelDataFrameSet channelDataFrameSet)
 {
     Notify(OnChannelDataFrameSet, header, channelDataFrameSet);
 }
Beispiel #3
0
        /// <summary>
        /// Sends a complete multi-part set of ChannelMetadata and ChannelDataFrameSet messages to a consumer.
        /// If there are no frame sets in the list, an empty ChannelDataFrameSet message is sent.
        /// </summary>
        /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
        /// <param name="channelMetadata">The list of channel metadata.</param>
        /// <param name="frameSet">The frame set.</param>
        /// <param name="setFinalPart">Whether or not the final part flag should be set on the last ChannelDataFrameSet message.</param>
        /// <returns>The first message sent in the response on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <ChannelMetadata> RequestChannelDataResponse(IMessageHeader correlatedHeader, IList <ChannelMetadataRecord> channelMetadata, ChannelDataFrameSet frameSet, bool setFinalPart = true)
        {
            var message = ChannelMetadata(correlatedHeader, channelMetadata ?? new List <ChannelMetadataRecord>());

            if (frameSet != null)
            {
                var ret = ChannelDataFrameSet(correlatedHeader, frameSet, isFinalPart: setFinalPart);
                if (ret == null)
                {
                    return(null);
                }
            }

            return(message);
        }
Beispiel #4
0
        /// <summary>
        /// Sends a ChannelDataFrameSet message to a consumer.
        /// </summary>
        /// <param name="correlatedHeader">The message header that the message to send is correlated with.</param>
        /// <param name="frameSet">The channel data frame set.</param>
        /// <param name="isFinalPart">Whether or not this is the final part of a multi-part message.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <ChannelDataFrameSet> ChannelDataFrameSet(IMessageHeader correlatedHeader, ChannelDataFrameSet frameSet, bool isFinalPart = true)
        {
            var body = frameSet;

            return(SendResponse(body, correlatedHeader, isMultiPart: true, isFinalPart: isFinalPart, isNoData: frameSet?.Data?.Count == 0));
        }