View Javadoc

1   /*
2    * ====================================================================
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   * ====================================================================
20   *
21   * This software consists of voluntary contributions made by many
22   * individuals on behalf of the Apache Software Foundation.  For more
23   * information on the Apache Software Foundation, please see
24   * <http://www.apache.org/>.
25   *
26   */
27  
28  package org.apache.http.params;
29  
30  /**
31   * Defines parameter names for connections in HttpCore.
32   *
33   * @since 4.0
34   *
35   * @deprecated (4.3) use configuration classes provided 'org.apache.http.config'
36   *  and 'org.apache.http.client.config'
37   */
38  @Deprecated
39  public interface CoreConnectionPNames {
40  
41      /**
42       * Defines the socket timeout (<code>SO_TIMEOUT</code>) in milliseconds,
43       * which is the timeout for waiting for data  or, put differently,
44       * a maximum period inactivity between two consecutive data packets).
45       * A timeout value of zero is interpreted as an infinite timeout.
46       * <p>
47       * This parameter expects a value of type {@link Integer}.
48       * </p>
49       * @see java.net.SocketOptions#SO_TIMEOUT
50       */
51      public static final String SO_TIMEOUT = "http.socket.timeout";
52  
53      /**
54       * Determines whether Nagle's algorithm is to be used. The Nagle's algorithm
55       * tries to conserve bandwidth by minimizing the number of segments that are
56       * sent. When applications wish to decrease network latency and increase
57       * performance, they can disable Nagle's algorithm (that is enable
58       * TCP_NODELAY). Data will be sent earlier, at the cost of an increase
59       * in bandwidth consumption.
60       * <p>
61       * This parameter expects a value of type {@link Boolean}.
62       * </p>
63       * @see java.net.SocketOptions#TCP_NODELAY
64       */
65      public static final String TCP_NODELAY = "http.tcp.nodelay";
66  
67      /**
68       * Determines the size of the internal socket buffer used to buffer data
69       * while receiving / transmitting HTTP messages.
70       * <p>
71       * This parameter expects a value of type {@link Integer}.
72       * </p>
73       */
74      public static final String SOCKET_BUFFER_SIZE = "http.socket.buffer-size";
75  
76      /**
77       * Sets SO_LINGER with the specified linger time in seconds. The maximum
78       * timeout value is platform specific. Value <code>0</code> implies that
79       * the option is disabled. Value <code>-1</code> implies that the JRE
80       * default is used. The setting only affects the socket close operation.
81       * <p>
82       * This parameter expects a value of type {@link Integer}.
83       * </p>
84       * @see java.net.SocketOptions#SO_LINGER
85       */
86      public static final String SO_LINGER = "http.socket.linger";
87  
88      /**
89       * Defines whether the socket can be bound even though a previous connection is
90       * still in a timeout state.
91       * <p>
92       * This parameter expects a value of type {@link Boolean}.
93       * </p>
94       * @see java.net.Socket#setReuseAddress(boolean)
95       *
96       * @since 4.1
97       */
98      public static final String SO_REUSEADDR = "http.socket.reuseaddr";
99  
100     /**
101      * Determines the timeout in milliseconds until a connection is established.
102      * A timeout value of zero is interpreted as an infinite timeout.
103      * <p>
104      * Please note this parameter can only be applied to connections that
105      * are bound to a particular local address.
106      * <p>
107      * This parameter expects a value of type {@link Integer}.
108      * </p>
109      */
110     public static final String CONNECTION_TIMEOUT = "http.connection.timeout";
111 
112     /**
113      * Determines whether stale connection check is to be used. The stale
114      * connection check can cause up to 30 millisecond overhead per request and
115      * should be used only when appropriate. For performance critical
116      * operations this check should be disabled.
117      * <p>
118      * This parameter expects a value of type {@link Boolean}.
119      * </p>
120      */
121     public static final String STALE_CONNECTION_CHECK = "http.connection.stalecheck";
122 
123     /**
124      * Determines the maximum line length limit. If set to a positive value,
125      * any HTTP line exceeding this limit will cause an IOException. A negative
126      * or zero value will effectively disable the check.
127      * <p>
128      * This parameter expects a value of type {@link Integer}.
129      * </p>
130      */
131     public static final String MAX_LINE_LENGTH = "http.connection.max-line-length";
132 
133     /**
134      * Determines the maximum HTTP header count allowed. If set to a positive
135      * value, the number of HTTP headers received from the data stream exceeding
136      * this limit will cause an IOException. A negative or zero value will
137      * effectively disable the check.
138      * <p>
139      * This parameter expects a value of type {@link Integer}.
140      * </p>
141      */
142     public static final String MAX_HEADER_COUNT = "http.connection.max-header-count";
143 
144     /**
145      * Defines the size limit below which data chunks should be buffered in a session I/O buffer
146      * in order to minimize native method invocations on the underlying network socket.
147      * The optimal value of this parameter can be platform specific and defines a trade-off
148      * between performance of memory copy operations and that of native method invocation.
149      * <p>
150      * This parameter expects a value of type {@link Integer}.
151      * </p>
152      *
153      * @since 4.1
154      */
155     public static final String MIN_CHUNK_LIMIT = "http.connection.min-chunk-limit";
156 
157 
158     /**
159      * Defines whether or not TCP is to send automatically a keepalive probe to the peer
160      * after an interval of inactivity (no data exchanged in either direction) between this
161      * host and the peer. The purpose of this option is to detect if the peer host crashes.
162      * <p>
163      * This parameter expects a value of type {@link Boolean}.
164      * </p>
165      * @see java.net.SocketOptions#SO_KEEPALIVE
166      * @since 4.2
167      */
168     public static final String SO_KEEPALIVE = "http.socket.keepalive";
169 
170 }