Beispiel #1
0
        /// <summary>
        /// Sends a ChannelRemove message to a consumer.
        /// </summary>
        /// <param name="channelId">The channel identifier.</param>
        /// <param name="reason">The reason.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <ChannelRemove> ChannelRemove(long channelId, string reason = null)
        {
            var body = new ChannelRemove()
            {
                ChannelId    = channelId,
                RemoveReason = reason ?? string.Empty
            };

            return(SendNotification(body));
        }
        /// <summary>
        /// Sends a ChannelRemove message to a consumer.
        /// </summary>
        /// <param name="channelId">The channel identifier.</param>
        /// <param name="reason">The reason.</param>
        /// <returns>The message identifier.</returns>
        public virtual long ChannelRemove(long channelId, string reason = null)
        {
            var header = CreateMessageHeader(Protocols.ChannelStreaming, MessageTypes.ChannelStreaming.ChannelRemove);

            var channelRemove = new ChannelRemove()
            {
                ChannelId    = channelId,
                RemoveReason = reason
            };

            return(Session.SendMessage(header, channelRemove));
        }
 /// <summary>
 /// Handles the ChannelRemove message from a producer.
 /// </summary>
 /// <param name="header">The message header.</param>
 /// <param name="channelRemove">The ChannelRemove message.</param>
 protected virtual void HandleChannelRemove(IMessageHeader header, ChannelRemove channelRemove)
 {
     Notify(OnChannelRemove, header, channelRemove);
 }