Exemple #1
0
        protected override void DoStart()
        {
            try
            {
                if (m_Sinks == null || !m_Sinks.Any())
                {
                    throw new WebException("Message sink registry is empty");
                }

                foreach (var sink in m_Sinks)
                {
                    sink.Start();
                }
            }
            catch (Exception error)
            {
                AbortStart();
                App.Log.Write(MessageType.CatastrophicError, error.ToMessageWithType(), "DoStart() exception", "CompositeMessageSink");
                throw error;
            }
        }
Exemple #2
0
        protected override void DoStart()
        {
            try
            {
                if (m_Sinks == null || !m_Sinks.Any())
                {
                    throw new WebException("Message sink registry is empty");
                }

                foreach (var sink in m_Sinks)
                {
                    sink.Start();
                }
            }
            catch (Exception error)
            {
                AbortStart();
                WriteLog(MessageType.CatastrophicError, nameof(DoStart), error.ToMessageWithType(), error);
                throw error;
            }
        }
Exemple #3
0
        private string makeUniqueBoundary(Encoding encoding)
        {
            while (true)
            {
                var boundary = BOUNDARY_PREFIX + Guid.NewGuid().ToString("N");
                var sequence = encoding.GetBytes(boundary);

                if (!m_Parts.Any(p =>
                {
                    var content = getPartByteContent(p, encoding);
                    return(findIndex(content, 0, content.Length, sequence) != NOT_FOUND_POS);
                })
                    )
                {
                    return(boundary);
                }
            }
        }
Exemple #4
0
        protected override void DoStart()
        {
            try
            {
                if (!m_Sinks.Any())
                {
                    throw new WebException("Message sink registry is empty");
                }

                m_Sinks.ForEach(s => s.Start());
            }
            catch (Exception error)
            {
                AbortStart();
                WriteLog(MessageType.CatastrophicError, nameof(DoStart), error.ToMessageWithType(), error);
                throw error;
            }
        }