Ejemplo n.º 1
0
        /// <summary>
        /// The client MUST be connected to access to this service.
        /// Demands the server a subscription to a channel.
        /// The server will check if not already subscribed and if authorized subscribe him.
        /// </summary>
        /// <param name="actor">channel id</param>
        /// <param name="messageDelegate">An action notified when a result issued</param>
        public void Subscribe(string actor, Action <HMessage> messageDelegate)
        {
            if (messageDelegate == null)
            {
                throw new MissingAttrException("messageDelegate");
            }

            HMessage cmdMessage = BuildCommand(actor, "hSubscribe", null, null, null);

            cmdMessage.SetTimeout(options.GetMsgTimeout());
            this.Send(cmdMessage, messageDelegate);
        }