Example #1
0
        /// <summary>
        /// Make a replication. An invalid operation exception will be thrown if not replicable.
        /// </summary>
        /// <returns>True for success; and false for failure</returns>
        public bool DoReplication()
        {
            if (m_mapQueueConn.Count == 1)
            {
                throw new InvalidOperationException("No replication is allowed because the number of target message queues less than two");
            }
            IClientQueue src = SourceQueue;

            if (src == null)
            {
                return(false);
            }
            return(src.AppendTo(TargetQueues));
        }
Example #2
0
        public bool EndJob()
        {
            IClientQueue src = SourceQueue;

            if (src == null || !src.Available)
            {
                return(false);
            }
            bool ok = src.EndJob();

            if (ok && Replicable)
            {
                ok = src.AppendTo(TargetQueues);
            }
            return(ok);
        }
Example #3
0
        virtual public bool Send(ushort reqId, byte[] data, uint len)
        {
            CAsyncServiceHandler.DAsyncResultHandler ash = null;
            THandler src = SourceHandler;

            if (src == null)
            {
                return(false);
            }
            IClientQueue cq = src.AttachedClientSocket.ClientQueue;

            if (!cq.Available)
            {
                return(false);
            }
            bool ok = src.SendRequest(reqId, data, len, ash);

            if (Replicable && cq.JobSize == 0)
            {
                ok = cq.AppendTo(TargetQueues);
            }
            return(ok);
        }