Socket Class Reference
[Various accompanying utilities]

List of all members.

Public Member Functions

 __construct ()
 __destruct ()
 setHost ($host)
 
Returns:
Socket

 getHost ()
 setPort ($port)
 
Returns:
Socket

 getPort ()
 isConnected ()
 getInputStream ()
 
Returns:
SocketInputStream

 getOutputStream ()
 
Returns:
SocketOutputStream

 connect ($connectTimeout=self::DEFAULT_TIMEOUT)
 
Returns:
Socket

 setReadTimeout ($timeout)
 
Returns:
Socket

 setWriteTimeout ($timeout)
 
Returns:
Socket

 setTimeout ($timeout)
 
Returns:
Socket

 getReadTimeout ()
 getWriteTimeout ()
 read ($length)
 returns 8-bit string or false on timeout or null on eof
 write ($buffer, $length=null)
 returns number of written bytes or false on timeout
 isTimedOut ()
 shutdownInput ()
 
Returns:
Socket

 shutdownOutput ()
 
Returns:
Socket

 close ()
 
Returns:
Socket


Static Public Member Functions

static create ()
 
Returns:
Socket


Public Attributes

const DEFAULT_TIMEOUT = 1000
const EAGAIN = 11

Private Member Functions

 checkRead ()
 checkWrite ()

Static Private Member Functions

static getSeconds ($timeout)
static getMicroseconds ($timeout)

Private Attributes

 $socket = null
 $connected = false
 $host = null
 $port = null
 $inputStream = null
 $outputStream = null
 $closed = false
 $inputShutdown = false
 $outputShutdown = false
 $readTimeout = null
 $writeTimeout = null


Detailed Description

Definition at line 16 of file Socket.class.php.


Constructor & Destructor Documentation

Socket::__construct (  ) 

Definition at line 39 of file Socket.class.php.

Socket::__destruct (  ) 

Definition at line 54 of file Socket.class.php.

References close().

Here is the call graph for this function:


Member Function Documentation

static Socket::create (  )  [static]

Returns:
Socket

Definition at line 68 of file Socket.class.php.

Socket::setHost ( host  ) 

Returns:
Socket

Definition at line 76 of file Socket.class.php.

References $host, and Assert::isNull().

Here is the call graph for this function:

Socket::getHost (  ) 

Definition at line 85 of file Socket.class.php.

Socket::setPort ( port  ) 

Returns:
Socket

Definition at line 93 of file Socket.class.php.

References $port, and Assert::isNull().

Here is the call graph for this function:

Socket::getPort (  ) 

Definition at line 102 of file Socket.class.php.

Socket::isConnected (  ) 

Definition at line 107 of file Socket.class.php.

Socket::getInputStream (  ) 

Returns:
SocketInputStream

Definition at line 115 of file Socket.class.php.

References checkRead().

Here is the call graph for this function:

Socket::getOutputStream (  ) 

Returns:
SocketOutputStream

Definition at line 125 of file Socket.class.php.

References checkWrite().

Here is the call graph for this function:

Socket::connect ( connectTimeout = self::DEFAULT_TIMEOUT  ) 

Returns:
Socket

Definition at line 135 of file Socket.class.php.

References Assert::isTrue(), setReadTimeout(), and setWriteTimeout().

Here is the call graph for this function:

Socket::setReadTimeout ( timeout  ) 

Returns:
Socket

Definition at line 197 of file Socket.class.php.

Referenced by connect(), and setTimeout().

Socket::setWriteTimeout ( timeout  ) 

Returns:
Socket

Definition at line 214 of file Socket.class.php.

Referenced by connect(), and setTimeout().

Socket::setTimeout ( timeout  ) 

Returns:
Socket

Definition at line 231 of file Socket.class.php.

References setReadTimeout(), and setWriteTimeout().

Here is the call graph for this function:

Socket::getReadTimeout (  ) 

Definition at line 240 of file Socket.class.php.

Socket::getWriteTimeout (  ) 

Definition at line 248 of file Socket.class.php.

Socket::read ( length  ) 

returns 8-bit string or false on timeout or null on eof

Definition at line 258 of file Socket.class.php.

References checkRead(), and isTimedOut().

Referenced by checkRead().

Here is the call graph for this function:

Socket::write ( buffer,
length = null 
)

returns number of written bytes or false on timeout

Definition at line 285 of file Socket.class.php.

References checkWrite(), and isTimedOut().

Referenced by checkWrite().

Here is the call graph for this function:

Socket::isTimedOut (  ) 

Definition at line 311 of file Socket.class.php.

Referenced by read(), and write().

Socket::shutdownInput (  ) 

Returns:
Socket

Definition at line 319 of file Socket.class.php.

Referenced by close().

Socket::shutdownOutput (  ) 

Returns:
Socket

Definition at line 331 of file Socket.class.php.

Referenced by close().

Socket::close (  ) 

Returns:
Socket

Definition at line 343 of file Socket.class.php.

References shutdownInput(), and shutdownOutput().

Referenced by __destruct().

Here is the call graph for this function:

static Socket::getSeconds ( timeout  )  [static, private]

Definition at line 358 of file Socket.class.php.

static Socket::getMicroseconds ( timeout  )  [static, private]

Definition at line 363 of file Socket.class.php.

Socket::checkRead (  )  [private]

Definition at line 368 of file Socket.class.php.

References read().

Referenced by getInputStream(), and read().

Here is the call graph for this function:

Socket::checkWrite (  )  [private]

Definition at line 377 of file Socket.class.php.

References write().

Referenced by getOutputStream(), and write().

Here is the call graph for this function:


Member Data Documentation

const Socket::DEFAULT_TIMEOUT = 1000

Definition at line 18 of file Socket.class.php.

const Socket::EAGAIN = 11

Definition at line 20 of file Socket.class.php.

Socket::$socket = null [private]

Definition at line 22 of file Socket.class.php.

Socket::$connected = false [private]

Definition at line 23 of file Socket.class.php.

Socket::$host = null [private]

Definition at line 25 of file Socket.class.php.

Referenced by setHost().

Socket::$port = null [private]

Definition at line 26 of file Socket.class.php.

Referenced by setPort().

Socket::$inputStream = null [private]

Definition at line 28 of file Socket.class.php.

Socket::$outputStream = null [private]

Definition at line 29 of file Socket.class.php.

Socket::$closed = false [private]

Definition at line 31 of file Socket.class.php.

Socket::$inputShutdown = false [private]

Definition at line 32 of file Socket.class.php.

Socket::$outputShutdown = false [private]

Definition at line 33 of file Socket.class.php.

Socket::$readTimeout = null [private]

Definition at line 36 of file Socket.class.php.

Socket::$writeTimeout = null [private]

Definition at line 37 of file Socket.class.php.


The documentation for this class was generated from the following file:
Generated on Sun Dec 9 21:58:29 2007 for onPHP by  doxygen 1.5.4