Exemple #1
0
        /// <summary>
        /// 初始化新建一个 <see cref="MultiRemoteObject" /> 类的实例对象。
        /// </summary>
        /// <param name="source">本地消息队列的名称。</param>
        /// <exception cref="System.ArgumentNullException">source</exception>
        public MultiRemoteObject(string source)
        {
            if (string.IsNullOrEmpty(source))
            {
                throw new ArgumentNullException("source");
            }

            _source   = MessageProxyCreater.CreateLocalQueue(string.Format(@".\private$\{0}", source));
            _template = string.Concat(@"FormatName:DIRECT=TCP:{0}\private$\", source);

            Clients = new List <string>();
        }
        /// <summary>
        /// 初始化新建一个 <see cref="SingleRemoteObject"/> 类的实例对象。
        /// </summary>
        /// <param name="target">待发送的目标地址。</param>
        /// <param name="source">接受监听的地址路径。</param>
        /// <exception cref="System.ArgumentNullException">
        /// target
        /// or
        /// source
        /// </exception>
        public SingleRemoteObject(string target, string source)
        {
            if (string.IsNullOrEmpty(target))
            {
                throw new ArgumentNullException("target");
            }
            if (string.IsNullOrEmpty(source))
            {
                throw new ArgumentNullException("source");
            }

            _source = MessageProxyCreater.CreateLocalQueue(source);
            _target = MessageProxyCreater.CreateRemoteQueue(target);
        }