Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public class

SocketHttpClientConnection

extends AbstractHttpClientConnection
implements HttpInetConnection
java.lang.Object
   ↳ org.apache.http.impl.AbstractHttpClientConnection
     ↳ org.apache.http.impl.SocketHttpClientConnection
Known Direct Subclasses

Class Overview

Implementation of a client-side HTTP connection that can be bound to a network Socket in order to receive and transmit data.

Summary

Public Constructors
SocketHttpClientConnection ()
Public Methods
void close ()
Closes this connection gracefully.
InetAddress getLocalAddress ()
int getLocalPort ()
InetAddress getRemoteAddress ()
int getRemotePort ()
int getSocketTimeout ()
Returns the socket timeout value.
boolean isOpen ()
Checks if this connection is open.
void setSocketTimeout (int timeout)
Sets the socket timeout value.
void shutdown ()
Force-closes this connection.
Protected Methods
void assertNotOpen ()
void assertOpen ()
void bind ( Socket socket, HttpParams params)
SessionInputBuffer createSessionInputBuffer ( Socket socket, int buffersize, HttpParams params)
SessionOutputBuffer createSessionOutputBuffer ( Socket socket, int buffersize, HttpParams params)
Socket getSocket ()
[Expand]
Inherited Methods
From class org.apache.http.impl.AbstractHttpClientConnection
From class java.lang.Object
From interface org.apache.http.HttpClientConnection
From interface org.apache.http.HttpConnection
From interface org.apache.http.HttpInetConnection

Public Constructors

public SocketHttpClientConnection ()

Added in API level 1

Public Methods

public void close ()

Added in API level 1

Closes this connection gracefully. This method will attempt to flush the transmitter's internal buffer prior to closing the underlying socket. This method MUST NOT be called from a different thread to force shutdown of the connection. Use shutdown instead.

public InetAddress getLocalAddress ()

Added in API level 1

public int getLocalPort ()

Added in API level 1

public InetAddress getRemoteAddress ()

Added in API level 1

public int getRemotePort ()

Added in API level 1

public int getSocketTimeout ()

Added in API level 1

Returns the socket timeout value.

Returns
  • positive value in milliseconds if a timeout is set, 0 if timeout is disabled or -1 if timeout is undefined.

public boolean isOpen ()

Added in API level 1

Checks if this connection is open.

Returns
  • true if it is open, false if it is closed.

public void setSocketTimeout (int timeout)

Added in API level 1

Sets the socket timeout value.

Parameters
timeout timeout value in milliseconds

public void shutdown ()

Added in API level 1

Force-closes this connection. This is the only method of a connection which may be called from a different thread to terminate the connection. This method will not attempt to flush the transmitter's internal buffer prior to closing the underlying socket.

Protected Methods

protected void assertNotOpen ()

Added in API level 1

protected void assertOpen ()

Added in API level 1

protected void bind ( Socket socket, HttpParams params)

Added in API level 1

protected SessionInputBuffer createSessionInputBuffer ( Socket socket, int buffersize, HttpParams params)

Added in API level 1

protected SessionOutputBuffer createSessionOutputBuffer ( Socket socket, int buffersize, HttpParams params)

Added in API level 1

protected Socket getSocket ()

Added in API level 1