CakeSocket Class Reference

Inheritance diagram for CakeSocket:

Object HttpSocket List of all members.

Public Member Functions

 __construct ($config=array())
 __destruct ()
 abort ()
 address ()
 addresses ()
 connect ()
 disconnect ()
 host ()
 lastError ()
 read ($length=1024)
 reset ($state=null)
 setLastError ($errNum, $errStr)
 write ($data)

Public Attributes

 $_baseConfig
 $config = array()
 $connected = false
 $connection = null
 $description = 'Remote DataSource Network Socket Interface'
 $lastError = array()

Detailed Description

Definition at line 34 of file socket.php.


Constructor & Destructor Documentation

CakeSocket::__construct ( config = array()  ) 

Constructor.

Parameters:
array $config Socket configuration, which will be merged with the base configuration

Reimplemented in HttpSocket.

Definition at line 88 of file socket.php.

References $config, __construct(), and config().

CakeSocket::__destruct (  ) 

Destructor, used to disconnect from current connection.

private

Definition at line 267 of file socket.php.

References disconnect().


Member Function Documentation

CakeSocket::abort (  ) 

Abort socket operation.

Returns:
boolean Success public

Definition at line 242 of file socket.php.

CakeSocket::address (  ) 

Get the IP address of the current connection.

Returns:
string IP address public

Definition at line 149 of file socket.php.

References config(), host(), and Validation::ip().

Referenced by host().

CakeSocket::addresses (  ) 

Get all IP addresses associated with the current connection.

Returns:
array IP addresses public

Definition at line 162 of file socket.php.

References config(), host(), and Validation::ip().

CakeSocket::connect (  ) 

Connect the socket to the given host and port.

Returns:
boolean Success public

Definition at line 102 of file socket.php.

References config(), disconnect(), host(), and setLastError().

Referenced by read(), and write().

CakeSocket::disconnect (  ) 

Disconnect the socket from the current connection.

Returns:
boolean Success public

Definition at line 250 of file socket.php.

Referenced by __destruct(), connect(), and HttpSocket::request().

CakeSocket::host (  ) 

Get the host name of the current connection.

Returns:
string Host name public

Definition at line 136 of file socket.php.

References address(), config(), and Validation::ip().

Referenced by address(), addresses(), HttpSocket::buildUri(), HttpSocket::configUri(), connect(), HttpSocket::request(), and HttpSocket::url().

CakeSocket::lastError (  ) 

Get the last error as a string.

Returns:
string Last error public

Definition at line 175 of file socket.php.

Referenced by setLastError().

CakeSocket::read ( length = 1024  ) 

Read data from the socket. Returns false if no data is available or no connection could be established.

Parameters:
integer $length Optional buffer length to read; defaults to 1024
Returns:
mixed Socket data public

Definition at line 217 of file socket.php.

References __(), connect(), and setLastError().

Referenced by HttpSocket::request().

CakeSocket::reset ( state = null  ) 

Resets the state of this Socket instance to it's initial state (before Object::__construct got executed)

Returns:
boolean True on success public

Reimplemented in HttpSocket.

Definition at line 276 of file socket.php.

CakeSocket::setLastError ( errNum,
errStr 
)

Set the last error.

Parameters:
integer $errNum Error code
string $errStr Error string public

Definition at line 189 of file socket.php.

References lastError().

Referenced by connect(), and read().

CakeSocket::write ( data  ) 

Write data to the socket.

Parameters:
string $data The data to write to the socket
Returns:
boolean Success public

Definition at line 199 of file socket.php.

References connect().

Referenced by HttpSocket::request().


Member Data Documentation

CakeSocket::$_baseConfig

Initial value:

 array(
        'persistent'    => false,
        'host'          => 'localhost',
        'protocol'      => 'tcp',
        'port'          => 80,
        'timeout'       => 30
    )

Definition at line 48 of file socket.php.

CakeSocket::$config = array()

Reimplemented in HttpSocket.

Definition at line 61 of file socket.php.

Referenced by __construct().

CakeSocket::$connected = false

Definition at line 75 of file socket.php.

CakeSocket::$connection = null

Definition at line 68 of file socket.php.

CakeSocket::$description = 'Remote DataSource Network Socket Interface'

Reimplemented in HttpSocket.

Definition at line 41 of file socket.php.

CakeSocket::$lastError = array()

Definition at line 82 of file socket.php.


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:55 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7