Ejemplo n.º 1
0
        /// <summary>
        /// Sends a ChannelData message to a consumer.
        /// </summary>
        /// <param name="data">The list of <see cref="DataItem" /> objects.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <ChannelData> ChannelData(IList <DataItem> data, IMessageHeaderExtension extension = null)
        {
            var body = new ChannelData()
            {
                Data = data ?? new List <DataItem>(),
            };

            return(SendData(body, extension: extension));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sends a ChannelData message to a consumer.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <param name="dataItems">The list of <see cref="DataItem" /> objects.</param>
        /// <param name="messageFlag">The message flag.</param>
        /// <returns>The message identifier.</returns>
        public virtual long ChannelData(IMessageHeader request, IList <DataItem> dataItems, MessageFlags messageFlag = MessageFlags.MultiPart)
        {
            var header = CreateMessageHeader(Protocols.ChannelStreaming, MessageTypes.ChannelStreaming.ChannelData, messageFlags: messageFlag);

            var channelData = new ChannelData
            {
                Data = dataItems
            };

            return(Session.SendMessage(header, channelData));
        }
 /// <summary>
 /// Handles the ChannelData message from a producer.
 /// </summary>
 /// <param name="header">The message header.</param>
 /// <param name="channelData">The ChannelData message.</param>
 protected virtual void HandleChannelData(IMessageHeader header, ChannelData channelData)
 {
     Notify(OnChannelData, header, channelData);
 }