Beispiel #1
0
 public DefaultManagedHttpClientConnection(string id, int buffersize, int fragmentSizeHint
                                           , CharsetDecoder chardecoder, CharsetEncoder charencoder, MessageConstraints constraints
                                           , ContentLengthStrategy incomingContentStrategy, ContentLengthStrategy outgoingContentStrategy
                                           , HttpMessageWriterFactory <IHttpRequest> requestWriterFactory, HttpMessageParserFactory
                                           <HttpResponse> responseParserFactory) : base(buffersize, fragmentSizeHint, chardecoder
                                                                                        , charencoder, constraints, incomingContentStrategy, outgoingContentStrategy, requestWriterFactory
                                                                                        , responseParserFactory)
 {
     this.id         = id;
     this.attributes = new ConcurrentHashMap <string, object>();
 }
 public DefaultBHttpClientConnectionFactory(ConnectionConfig cconfig, ContentLengthStrategy
                                            incomingContentStrategy, ContentLengthStrategy outgoingContentStrategy, HttpMessageWriterFactory
                                            <IHttpRequest> requestWriterFactory, HttpMessageParserFactory <HttpResponse> responseParserFactory
                                            ) : base()
 {
     this.cconfig = cconfig != null ? cconfig : ConnectionConfig.Default;
     this.incomingContentStrategy = incomingContentStrategy;
     this.outgoingContentStrategy = outgoingContentStrategy;
     this.requestWriterFactory    = requestWriterFactory;
     this.responseParserFactory   = responseParserFactory;
 }
Beispiel #3
0
 /// <summary>Creates new instance of DefaultBHttpClientConnection.</summary>
 /// <remarks>Creates new instance of DefaultBHttpClientConnection.</remarks>
 /// <param name="buffersize">buffer size. Must be a positive number.</param>
 /// <param name="fragmentSizeHint">fragment size hint.</param>
 /// <param name="chardecoder">
 /// decoder to be used for decoding HTTP protocol elements.
 /// If <code>null</code> simple type cast will be used for byte to char conversion.
 /// </param>
 /// <param name="charencoder">
 /// encoder to be used for encoding HTTP protocol elements.
 /// If <code>null</code> simple type cast will be used for char to byte conversion.
 /// </param>
 /// <param name="constraints">
 /// Message constraints. If <code>null</code>
 /// <see cref="Org.Apache.Http.Config.MessageConstraints.Default">Org.Apache.Http.Config.MessageConstraints.Default
 ///     </see>
 /// will be used.
 /// </param>
 /// <param name="incomingContentStrategy">
 /// incoming content length strategy. If <code>null</code>
 /// <see cref="Org.Apache.Http.Impl.Entity.LaxContentLengthStrategy.Instance">Org.Apache.Http.Impl.Entity.LaxContentLengthStrategy.Instance
 ///     </see>
 /// will be used.
 /// </param>
 /// <param name="outgoingContentStrategy">
 /// outgoing content length strategy. If <code>null</code>
 /// <see cref="Org.Apache.Http.Impl.Entity.StrictContentLengthStrategy.Instance">Org.Apache.Http.Impl.Entity.StrictContentLengthStrategy.Instance
 ///     </see>
 /// will be used.
 /// </param>
 /// <param name="requestWriterFactory">
 /// request writer factory. If <code>null</code>
 /// <see cref="Org.Apache.Http.Impl.IO.DefaultHttpRequestWriterFactory.Instance">Org.Apache.Http.Impl.IO.DefaultHttpRequestWriterFactory.Instance
 ///     </see>
 /// will be used.
 /// </param>
 /// <param name="responseParserFactory">
 /// response parser factory. If <code>null</code>
 /// <see cref="Org.Apache.Http.Impl.IO.DefaultHttpResponseParserFactory.Instance">Org.Apache.Http.Impl.IO.DefaultHttpResponseParserFactory.Instance
 ///     </see>
 /// will be used.
 /// </param>
 internal DefaultBHttpClientConnection(int buffersize, int fragmentSizeHint, CharsetDecoder
                                       chardecoder, CharsetEncoder charencoder, MessageConstraints constraints, ContentLengthStrategy
                                       incomingContentStrategy, ContentLengthStrategy outgoingContentStrategy, HttpMessageWriterFactory
                                       <IHttpRequest> requestWriterFactory, HttpMessageParserFactory <HttpResponse> responseParserFactory
                                       ) : base(buffersize, fragmentSizeHint, chardecoder, charencoder, constraints, incomingContentStrategy
                                                , outgoingContentStrategy)
 {
     this.requestWriter = (requestWriterFactory != null ? requestWriterFactory : DefaultHttpRequestWriterFactory
                           .Instance).Create(GetSessionOutputBuffer());
     this.responseParser = (responseParserFactory != null ? responseParserFactory : DefaultHttpResponseParserFactory
                            .Instance).Create(GetSessionInputBuffer(), constraints);
 }
 public LoggingManagedHttpClientConnection(string id, Log log, Log headerlog, Log
                                           wirelog, int buffersize, int fragmentSizeHint, CharsetDecoder chardecoder, CharsetEncoder
                                           charencoder, MessageConstraints constraints, ContentLengthStrategy incomingContentStrategy
                                           , ContentLengthStrategy outgoingContentStrategy, HttpMessageWriterFactory <IHttpRequest
                                                                                                                      > requestWriterFactory, HttpMessageParserFactory <HttpResponse> responseParserFactory
                                           ) : base(id, buffersize, fragmentSizeHint, chardecoder, charencoder, constraints
                                                    , incomingContentStrategy, outgoingContentStrategy, requestWriterFactory, responseParserFactory
                                                    )
 {
     this.log       = log;
     this.headerlog = headerlog;
     this.wire      = new Wire(wirelog, id);
 }
        /// <summary>Creates new instance of BHttpConnectionBase.</summary>
        /// <remarks>Creates new instance of BHttpConnectionBase.</remarks>
        /// <param name="buffersize">buffer size. Must be a positive number.</param>
        /// <param name="fragmentSizeHint">fragment size hint.</param>
        /// <param name="chardecoder">
        /// decoder to be used for decoding HTTP protocol elements.
        /// If <code>null</code> simple type cast will be used for byte to char conversion.
        /// </param>
        /// <param name="charencoder">
        /// encoder to be used for encoding HTTP protocol elements.
        /// If <code>null</code> simple type cast will be used for char to byte conversion.
        /// </param>
        /// <param name="constraints">
        /// Message constraints. If <code>null</code>
        /// <see cref="Org.Apache.Http.Config.MessageConstraints.Default">Org.Apache.Http.Config.MessageConstraints.Default
        ///     </see>
        /// will be used.
        /// </param>
        /// <param name="incomingContentStrategy">
        /// incoming content length strategy. If <code>null</code>
        /// <see cref="Org.Apache.Http.Impl.Entity.LaxContentLengthStrategy.Instance">Org.Apache.Http.Impl.Entity.LaxContentLengthStrategy.Instance
        ///     </see>
        /// will be used.
        /// </param>
        /// <param name="outgoingContentStrategy">
        /// outgoing content length strategy. If <code>null</code>
        /// <see cref="Org.Apache.Http.Impl.Entity.StrictContentLengthStrategy.Instance">Org.Apache.Http.Impl.Entity.StrictContentLengthStrategy.Instance
        ///     </see>
        /// will be used.
        /// </param>
        internal BHttpConnectionBase(int buffersize, int fragmentSizeHint, CharsetDecoder
                                     chardecoder, CharsetEncoder charencoder, MessageConstraints constraints, ContentLengthStrategy
                                     incomingContentStrategy, ContentLengthStrategy outgoingContentStrategy) : base(
                )
        {
            Args.Positive(buffersize, "Buffer size");
            HttpTransportMetricsImpl inTransportMetrics  = new HttpTransportMetricsImpl();
            HttpTransportMetricsImpl outTransportMetrics = new HttpTransportMetricsImpl();

            this.inbuffer = new SessionInputBufferImpl(inTransportMetrics, buffersize, -1, constraints
                                                       != null ? constraints : MessageConstraints.Default, chardecoder);
            this.outbuffer = new SessionOutputBufferImpl(outTransportMetrics, buffersize, fragmentSizeHint
                                                         , charencoder);
            this.connMetrics = new HttpConnectionMetricsImpl(inTransportMetrics, outTransportMetrics
                                                             );
            this.incomingContentStrategy = incomingContentStrategy != null ? incomingContentStrategy
                                 : LaxContentLengthStrategy.Instance;
            this.outgoingContentStrategy = outgoingContentStrategy != null ? outgoingContentStrategy
                                 : StrictContentLengthStrategy.Instance;
        }
 public DisallowIdentityContentLengthStrategy(ContentLengthStrategy contentLengthStrategy
                                              ) : base()
 {
     this.contentLengthStrategy = contentLengthStrategy;
 }