|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| SimpleSocket ($host, $port, $timeout, $block_size=255) | |
| write ($message) | |
| read () | |
| isOpen () | |
| close () | |
| getSent () | |
| _openSocket ($host, $port, &$error_number, &$error, $timeout) | |
Data Fields | |
| $_handle | |
| $_is_open = false | |
| $_sent = '' | |
| $lock_size | |
Definition at line 74 of file socket.php.
| _openSocket | ( | $ | host, |
| $ | port, | ||
| &$ | error_number, | ||
| &$ | error, | ||
| $ | timeout | ||
| ) |
Actually opens the low level socket.
| string | $host | Host to connect to. |
| integer | $port | Port on host. |
| integer | $error_number | Recipient of error code. |
| string | $error | Recipoent of error message. |
| integer | $timeout | Maximum time to wait for connection. protected |
Reimplemented in SimpleSecureSocket.
Definition at line 180 of file socket.php.

| close | ( | ) |
Closes the socket preventing further reads. Cannot be reopened once closed.
Definition at line 157 of file socket.php.

| getSent | ( | ) |
Accessor for content so far.
Definition at line 167 of file socket.php.
| isOpen | ( | ) |
Accessor for socket open state.
Definition at line 147 of file socket.php.

| read | ( | ) |
Reads data from the socket. The error suppresion is a workaround for PHP4 always throwing a warning with a secure socket.
Definition at line 130 of file socket.php.

| SimpleSocket | ( | $ | host, |
| $ | port, | ||
| $ | timeout, | ||
| $ | block_size = 255 |
||
| ) |
Opens a socket for reading and writing.
| string | $host | Hostname to send request to. |
| integer | $port | Port on remote machine to open. |
| integer | $timeout | Connection timeout in seconds. |
| integer | $block_size | Size of chunk to read. public |
Definition at line 88 of file socket.php.


| write | ( | $ | message | ) |
Writes some data to the socket and saves alocal copy.
| string | $message | String to send to socket. |
Definition at line 105 of file socket.php.

| $_handle |
Definition at line 75 of file socket.php.
| $_is_open = false |
Definition at line 76 of file socket.php.
| $_sent = '' |
Definition at line 77 of file socket.php.
| $lock_size |
Definition at line 78 of file socket.php.