Android
org.apache.http.conn.scheme
public final class

org.apache.http.conn.scheme.PlainSocketFactory

java.lang.Object
org.apache.http.conn.scheme.PlainSocketFactory SocketFactory

The default class for creating sockets.

Summary

Public Constructors

            PlainSocketFactory(HostNameResolver nameResolver)
            PlainSocketFactory()

Public Methods

          Socket  connectSocket(Socket sock, String host, int port, InetAddress localAddress, int localPort, HttpParams params)
Connects a socket to the given host.
          Socket  createSocket()
Creates a new, unconnected socket.
          boolean  equals(Object obj)
Compares this factory with an object.
      static    PlainSocketFactory  getSocketFactory()
Gets the singleton instance of this class.
          int  hashCode()
Obtains a hash code for this object.
    final      boolean  isSecure(Socket sock)
Checks whether a socket connection is secure.
Methods inherited from class java.lang.Object
Methods inherited from interface org.apache.http.conn.scheme.SocketFactory

Details

Public Constructors

public PlainSocketFactory(HostNameResolver nameResolver)

public PlainSocketFactory()

Public Methods

public Socket connectSocket(Socket sock, String host, int port, InetAddress localAddress, int localPort, HttpParams params)

Connects a socket to the given host.

Throws

IOException

public Socket createSocket()

Creates a new, unconnected socket. The socket should subsequently be passed to connectSocket.

public boolean equals(Object obj)

Compares this factory with an object. There is only one instance of this class.

Parameters

obj the object to compare with

Returns

  • iff the argument is this object

public static PlainSocketFactory getSocketFactory()

Gets the singleton instance of this class.

Returns

  • the one and only plain socket factory

public int hashCode()

Obtains a hash code for this object. All instances of this class have the same hash code. There is only one instance of this class.

Returns

  • int the receiver's hash.

public final boolean isSecure(Socket sock)

Checks whether a socket connection is secure. This factory creates plain socket connections which are not considered secure.

Parameters

sock the connected socket

Returns

  • false

Throws

IllegalArgumentException if the argument is invalid
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56