CakeSocket Class Reference

Inheritance diagram for CakeSocket:

Object HttpSocket

List of all members.


Public Member Functions

 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 37 of file socket.php.


Member Function Documentation

CakeSocket::abort (  ) 

Abort socket operation.

Returns:
boolean Success public

Definition at line 235 of file socket.php.

CakeSocket::address (  ) 

Get the IP address of the current connection.

Returns:
string IP address public

Definition at line 148 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 161 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 105 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 243 of file socket.php.

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

CakeSocket::host (  ) 

Get the host name of the current connection.

Returns:
string Host name public

Definition at line 135 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 174 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 216 of file socket.php.

References connect().

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 269 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 188 of file socket.php.

References lastError().

Referenced by connect().

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 198 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 51 of file socket.php.

CakeSocket::$config = array()

Reimplemented in HttpSocket.

Definition at line 64 of file socket.php.

CakeSocket::$connected = false

Definition at line 78 of file socket.php.

CakeSocket::$connection = null

Definition at line 71 of file socket.php.

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

Reimplemented in HttpSocket.

Definition at line 44 of file socket.php.

CakeSocket::$lastError = array()

Definition at line 85 of file socket.php.


The documentation for this class was generated from the following file: