• BlackBerry Dynamics
  • Runtime library for Android applications
  • 12.0.1.79
HttpConnectionParams Class Reference

An adaptor for accessing connection parameters in com.good.gd.apache.http.params.HttpParams. More...

Inheritance diagram for HttpConnectionParams:
CoreConnectionPNames

Description


Note that the implements relation to com.good.gd.apache.http.params.CoreConnectionPNames is for compatibility with existing application code only. References to the parameter names should use the interface, not this class.

Author
Oleg Kalnichevski
Version
Revision
576089
Since
4.0

Notice

The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.

/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Static Public Member Functions

static int getSoTimeout (final HttpParams params)
 Returns the default socket timeout (SO_TIMEOUT) in milliseconds which is the timeout for waiting for data. More...
 
static void setSoTimeout (final HttpParams params, int timeout)
 Sets the default socket timeout (SO_TIMEOUT) in milliseconds which is the timeout for waiting for data. More...
 
static boolean getTcpNoDelay (final HttpParams params)
 Tests if Nagle's algorithm is to be used. More...
 
static void setTcpNoDelay (final HttpParams params, boolean value)
 Determines whether Nagle's algorithm is to be used. More...
 
static int getLinger (final HttpParams params)
 Returns linger-on-close timeout. More...
 
static void setLinger (final HttpParams params, int value)
 Returns linger-on-close timeout. More...
 
static int getConnectionTimeout (final HttpParams params)
 Returns the timeout until a connection is etablished. More...
 
static void setConnectionTimeout (final HttpParams params, int timeout)
 Sets the timeout until a connection is etablished. More...
 
static boolean isStaleCheckingEnabled (final HttpParams params)
 Tests whether stale connection check is to be used. More...
 
static void setStaleCheckingEnabled (final HttpParams params, boolean value)
 Defines whether stale connection check is to be used. More...
 

Additional Inherited Members

- Static Public Attributes inherited from CoreConnectionPNames
static final String SO_TIMEOUT = "http.socket.timeout"
 Defines the default socket timeout (SO_TIMEOUT) in milliseconds which is the timeout for waiting for data. More...
 
static final String TCP_NODELAY = "http.tcp.nodelay"
 Determines whether Nagle's algorithm is to be used. More...
 
static final String SOCKET_BUFFER_SIZE = "http.socket.buffer-size"
 Determines the size of the internal socket buffer used to buffer data while receiving / transmitting HTTP messages. More...
 
static final String SO_LINGER = "http.socket.linger"
 Sets SO_LINGER with the specified linger time in seconds. More...
 
static final String CONNECTION_TIMEOUT = "http.connection.timeout"
 Determines the timeout until a connection is etablished. More...
 
static final String STALE_CONNECTION_CHECK = "http.connection.stalecheck"
 Determines whether stale connection check is to be used. More...
 
static final String MAX_LINE_LENGTH = "http.connection.max-line-length"
 Determines the maximum line length limit. More...
 
static final String MAX_HEADER_COUNT = "http.connection.max-header-count"
 Determines the maximum HTTP header count allowed. More...
 

Member Function Documentation

◆ getSoTimeout()

static int getSoTimeout ( final HttpParams  params)
static

A timeout value of zero is interpreted as an infinite timeout. This value is used when no socket timeout is set in the method parameters.

Parameters
paramsHTTP parameters.
Returns
timeout in milliseconds

◆ setSoTimeout()

static void setSoTimeout ( final HttpParams  params,
int  timeout 
)
static

A timeout value of zero is interpreted as an infinite timeout. This value is used when no socket timeout is set in the method parameters.

Parameters
paramsHTTP parameters.
timeoutTimeout in milliseconds

◆ getTcpNoDelay()

static boolean getTcpNoDelay ( final HttpParams  params)
static
Parameters
paramsHTTP parameters.
Returns
true if the Nagle's algorithm is to NOT be used (that is enable TCP_NODELAY), false otherwise.

◆ setTcpNoDelay()

static void setTcpNoDelay ( final HttpParams  params,
boolean  value 
)
static

The Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. When applications wish to decrease network latency and increase performance, they can disable Nagle's algorithm (that is enable TCP_NODELAY). Data will be sent earlier, at the cost of an increase in bandwidth consumption.

Parameters
paramsHTTP parameters.
valuetrue if the Nagle's algorithm is to NOT be used (that is enable TCP_NODELAY), false otherwise.

◆ getLinger()

static int getLinger ( final HttpParams  params)
static

Value 0 implies that the option is disabled. Value -1 implies that the JRE default is used.

Parameters
paramsHTTP parameters.
Returns
the linger-on-close timeout

◆ setLinger()

static void setLinger ( final HttpParams  params,
int  value 
)
static

This option disables/enables immediate return from a close() of a TCP Socket. Enabling this option with a non-zero Integer timeout means that a close() will block pending the transmission and acknowledgement of all data written to the peer, at which point the socket is closed gracefully. Value 0 implies that the option is disabled. Value -1 implies that the JRE default is used.

Parameters
paramsHTTP parameters.
valuethe linger-on-close timeout

◆ getConnectionTimeout()

static int getConnectionTimeout ( final HttpParams  params)
static

A value of zero means the timeout is not used. The default value is zero.

Parameters
paramsHTTP parameters.
Returns
timeout in milliseconds.

◆ setConnectionTimeout()

static void setConnectionTimeout ( final HttpParams  params,
int  timeout 
)
static

A value of zero means the timeout is not used. The default value is zero.

Parameters
paramsHTTP parameters.
timeoutTimeout in milliseconds.

◆ isStaleCheckingEnabled()

static boolean isStaleCheckingEnabled ( final HttpParams  params)
static

Disabling stale connection check may result in slight performance improvement at the risk of getting an I/O error when executing a request over a connection that has been closed at the server side.

Parameters
paramsHTTP parameters.
Returns
true if stale connection check is to be used, false otherwise.

◆ setStaleCheckingEnabled()

static void setStaleCheckingEnabled ( final HttpParams  params,
boolean  value 
)
static

Disabling stale connection check may result in slight performance improvement at the risk of getting an I/O error when executing a request over a connection that has been closed at the server side.

Parameters
paramsHTTP parameters.
valuetrue if stale connection check is to be used, false otherwise.