public static HttpPipeline CreatePipeline(HttpRequestContext httpRequestContext, TransportIntegrationHandler transportIntegrationHandler, bool isWebSocketTransport)
            {
                NormalHttpPipeline pipeline = isWebSocketTransport ? new WebSocketHttpPipeline(httpRequestContext, transportIntegrationHandler) :
                                              new NormalHttpPipeline(httpRequestContext, transportIntegrationHandler);

                pipeline.SetPipelineIncomingTimeout();
                return(pipeline);
            }
        public static HttpPipeline CreateHttpPipeline(HttpRequestContext httpRequestContext, TransportIntegrationHandler transportIntegrationHandler, bool isWebSocketTransport)
        {
            if (transportIntegrationHandler == null)
            {
                Fx.Assert(!isWebSocketTransport, "isWebSocketTransport should be false if there's no HTTP message handler existing.");

                if (httpRequestContext.HttpMessagesSupported)
                {
                    return(new HttpMessageSupportedHttpPipeline(httpRequestContext));
                }

                return(new EmptyHttpPipeline(httpRequestContext));
            }

            return(NormalHttpPipeline.CreatePipeline(httpRequestContext, transportIntegrationHandler, isWebSocketTransport));
        }
            static void OnCreateMessageAndEnqueue(object state)
            {
                try
                {
                    NormalHttpPipeline pipeline = (NormalHttpPipeline)state;
                    Fx.Assert(pipeline != null, "pipeline should not be null.");
                    pipeline.CreateMessageAndEnqueue();
                }
                catch (Exception ex)
                {
                    if (Fx.IsFatal(ex))
                    {
                        throw;
                    }

                    DiagnosticUtility.TraceHandledException(ex, TraceEventType.Information);
                }
            }