001/*
002 * ====================================================================
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements.  See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership.  The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License.  You may obtain a copy of the License at
010 *
011 *   http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing,
014 * software distributed under the License is distributed on an
015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016 * KIND, either express or implied.  See the License for the
017 * specific language governing permissions and limitations
018 * under the License.
019 * ====================================================================
020 *
021 * This software consists of voluntary contributions made by many
022 * individuals on behalf of the Apache Software Foundation.  For more
023 * information on the Apache Software Foundation, please see
024 * <http://www.apache.org/>.
025 *
026 */
027
028package org.apache.http.params;
029
030/**
031 * Defines parameter names for connections in HttpCore.
032 *
033 * @since 4.0
034 *
035 * @deprecated (4.3) use configuration classes provided 'org.apache.http.config'
036 *  and 'org.apache.http.client.config'
037 */
038@Deprecated
039public interface CoreConnectionPNames {
040
041    /**
042     * Defines the socket timeout ({@code SO_TIMEOUT}) in milliseconds,
043     * which is the timeout for waiting for data  or, put differently,
044     * a maximum period inactivity between two consecutive data packets).
045     * A timeout value of zero is interpreted as an infinite timeout.
046     * <p>
047     * This parameter expects a value of type {@link Integer}.
048     * </p>
049     * @see java.net.SocketOptions#SO_TIMEOUT
050     */
051    public static final String SO_TIMEOUT = "http.socket.timeout";
052
053    /**
054     * Determines whether Nagle's algorithm is to be used. The Nagle's algorithm
055     * tries to conserve bandwidth by minimizing the number of segments that are
056     * sent. When applications wish to decrease network latency and increase
057     * performance, they can disable Nagle's algorithm (that is enable
058     * TCP_NODELAY). Data will be sent earlier, at the cost of an increase
059     * in bandwidth consumption.
060     * <p>
061     * This parameter expects a value of type {@link Boolean}.
062     * </p>
063     * @see java.net.SocketOptions#TCP_NODELAY
064     */
065    public static final String TCP_NODELAY = "http.tcp.nodelay";
066
067    /**
068     * Determines the size of the internal socket buffer used to buffer data
069     * while receiving / transmitting HTTP messages.
070     * <p>
071     * This parameter expects a value of type {@link Integer}.
072     * </p>
073     */
074    public static final String SOCKET_BUFFER_SIZE = "http.socket.buffer-size";
075
076    /**
077     * Sets SO_LINGER with the specified linger time in seconds. The maximum
078     * timeout value is platform specific. Value {@code 0} implies that
079     * the option is disabled. Value {@code -1} implies that the JRE
080     * default is used. The setting only affects the socket close operation.
081     * <p>
082     * This parameter expects a value of type {@link Integer}.
083     * </p>
084     * @see java.net.SocketOptions#SO_LINGER
085     */
086    public static final String SO_LINGER = "http.socket.linger";
087
088    /**
089     * Defines whether the socket can be bound even though a previous connection is
090     * still in a timeout state.
091     * <p>
092     * This parameter expects a value of type {@link Boolean}.
093     * </p>
094     * @see java.net.Socket#setReuseAddress(boolean)
095     *
096     * @since 4.1
097     */
098    public static final String SO_REUSEADDR = "http.socket.reuseaddr";
099
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}