Class SimpleFileSocket

Description

Located in /socket.php (line 73)

SimpleStickyError
   |
   --SimpleFileSocket
Method Summary
 SimpleFileSocket __construct (SimpleUrl $file, [integer $block_size = 1024])
 boolean close ()
 string getSent ()
 boolean isOpen ()
 void openFile (SimpleUrl $file,  &$error, string $error, integer $timeout)
 integer/boolean read ()
 boolean write (string $message)
Methods
Constructor __construct (line 85)

Opens a socket for reading and writing.

  • access: public
SimpleFileSocket __construct (SimpleUrl $file, [integer $block_size = 1024])
  • SimpleUrl $file: Target URI to fetch.
  • integer $block_size: Size of chunk to read.

Redefinition of:
SimpleStickyError::__construct()
Sets the error to empty.
close (line 138)

Closes the socket preventing further reads.

Cannot be reopened once closed.

  • return: True if successful.
  • access: public
boolean close ()
getSent (line 149)

Accessor for content so far.

  • return: Bytes sent only.
  • access: public
string getSent ()
isOpen (line 128)

Accessor for socket open state.

  • return: True if open.
  • access: public
boolean isOpen ()
openFile (line 160)

Actually opens the low level socket.

  • access: protected
void openFile (SimpleUrl $file,  &$error, string $error, integer $timeout)
  • SimpleUrl $file: SimpleUrl file target.
  • string $error: Recipient of error message.
  • integer $timeout: Maximum time to wait for connection.
  • &$error
read (line 114)

Reads data from the socket. The error suppresion is a workaround for PHP4 always throwing a warning with a secure socket.

  • return: Incoming bytes. False on error.
  • access: public
integer/boolean read ()
write (line 102)

Writes some data to the socket and saves alocal copy.

  • return: True if successful.
  • access: public
boolean write (string $message)
  • string $message: String to send to socket.

Inherited Methods

Inherited From SimpleStickyError

 SimpleStickyError::__construct()
 SimpleStickyError::clearError()
 SimpleStickyError::getError()
 SimpleStickyError::isError()
 SimpleStickyError::setError()

Documentation generated on Sun, 31 Oct 2010 16:32:27 -0500 by phpDocumentor 1.4.3