コード例 #1
0
ファイル: CompositeMessageSink.cs プロジェクト: zhabis/nfx
        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;
            }
        }
コード例 #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;
            }
        }
コード例 #3
0
ファイル: Multipart.cs プロジェクト: sergey-msu/azos
        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);
                }
            }
        }
コード例 #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;
            }
        }