\Zend_Http_Client_Adapter_Socket
A sockets based (stream_socket_client) adapter class for Zend_Http_Client. Can be used on almost every PHP environment, and does not require any special extensions.
- Copyright: Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
- License: http://framework.zend.com/license/new-bsd New BSD License
Synopsis
class Zend_Http_Client_Adapter_Socket
implements
Zend_Http_Client_Adapter_Interface,Zend_Http_Client_Adapter_Stream
{
- // members
- protected resource|null $socket = NULL;
- protected array $connected_to = ;
- protected $out_stream = NULL;
- protected array $config = ;
- protected $method = NULL;
- protected $_context = NULL;
- // methods
- public void __construct()
- public void setConfig()
- public array getConfig()
- public Zend_Http_Client_Adapter_Socket setStreamContext()
- public resource getStreamContext()
- public void connect()
- public string write()
- public string read()
- public void close()
- protected void _checkSocketReadTimeout()
- public Zend_Http_Client_Adapter_Socket setOutputStream()
- public void __destruct()
Hierarchy
Members
protected
- $_context
—
resource
Stream context - $config
—
array
Parameters array - $connected_to
—
array
What host/port are we connected to? - $method
—
string
Request method - will be set by write() and might be used by read() - $out_stream
—
resource
Stream for storing output - $socket
—
resource|null
The socket for server connection
Methods
protected
- _checkSocketReadTimeout() — Check if the socket has timed out - if so close connection and throw an exception
public
- __construct() — Adapter constructor, currently empty. Config is set using setConfig()
- __destruct() — Destructor: make sure the socket is disconnected
- close() — Close the connection to the server
- connect() — Connect to the remote server
- getConfig() — Retrieve the array of all configuration options
- getStreamContext() — Get the stream context for the TCP connection to the server.
- read() — Read response from server
- setConfig() — Set the configuration array for the adapter
- setOutputStream() — Set output stream for the response
- setStreamContext() — Set the stream context for the TCP connection to the server
- write() — Send request to the remote server