TYPO3
7.6
|
Public Member Functions | |
__construct ($address, $timeout, array $contextOptions=array()) | |
__destruct () | |
read ($length) | |
readLine ($bufferSize, $localTimeout=null) | |
write ($data) | |
eof () | |
setDeadline ($deadline, $timeout) | |
enableCrypto () | |
Protected Member Functions | |
checkTimeout () | |
connectionWarningsHandler ($errno, $errstr) | |
Protected Attributes | |
$connectionWarnings = array() | |
$socket | |
$deadline | |
$timeout | |
Definition at line 39 of file SocketWrapper.php.
__construct | ( | $address, | |
$timeout, | |||
array | $contextOptions = array() |
||
) |
Class constructor, tries to establish connection
string | $address | Address for stream_socket_client() call, e.g. 'tcp://localhost:80' |
int | $timeout | Connection timeout (seconds) |
array | $contextOptions | Context options |
Definition at line 76 of file SocketWrapper.php.
References $timeout.
__destruct | ( | ) |
Destructor, disconnects socket
Definition at line 117 of file SocketWrapper.php.
|
protected |
Throws an Exception if stream timed out
HTTP_Request2_MessageException |
Definition at line 264 of file SocketWrapper.php.
References HTTP_Request2_Exception\TIMEOUT.
Referenced by read(), readLine(), and write().
|
protected |
Error handler to use during stream_socket_client() call
One stream_socket_client() call may produce multiple PHP warnings (especially OpenSSL-related), we keep them in an array to later use for the message of HTTP_Request2_ConnectionException
int | $errno | error level |
string | $errstr | error message |
Definition at line 289 of file SocketWrapper.php.
enableCrypto | ( | ) |
Turns on encryption on a socket
HTTP_Request2_ConnectionException |
Definition at line 240 of file SocketWrapper.php.
eof | ( | ) |
read | ( | $length | ) |
Wrapper around fread(), handles global request timeout
int | $length | Reads up to this number of bytes |
HTTP_Request2_MessageException | In case of timeout |
Definition at line 130 of file SocketWrapper.php.
References checkTimeout().
Referenced by HTTP_Request2_SOCKS5\__construct(), HTTP_Request2_SOCKS5\connect(), and HTTP_Request2_SOCKS5\performAuthentication().
readLine | ( | $bufferSize, | |
$localTimeout = null |
|||
) |
Reads until either the end of the socket or a newline, whichever comes first
Strips the trailing newline from the returned data, handles global request timeout. Method idea borrowed from Net_Socket PEAR package.
int | $bufferSize | buffer size to use for reading |
int | $localTimeout | timeout value to use just for this call (used when waiting for "100 Continue" response) |
HTTP_Request2_MessageException | In case of timeout |
Definition at line 153 of file SocketWrapper.php.
References checkTimeout(), elseif, and HTTP_Request2_Exception\TIMEOUT.
setDeadline | ( | $deadline, | |
$timeout | |||
) |
Sets request deadline
int | $deadline | Exception will be thrown if request continues past this time |
int | $timeout | Original request timeout value, to use in Exception message |
Definition at line 229 of file SocketWrapper.php.
References $deadline, and $timeout.
Referenced by HTTP_Request2_Adapter_Socket\connect().
write | ( | $data | ) |
Wrapper around fwrite(), handles global request timeout
string | $data | String to be written |
HTTP_Request2_MessageException |
Definition at line 197 of file SocketWrapper.php.
References checkTimeout().
Referenced by HTTP_Request2_SOCKS5\__construct(), HTTP_Request2_SOCKS5\connect(), and HTTP_Request2_SOCKS5\performAuthentication().
|
protected |
Definition at line 45 of file SocketWrapper.php.
|
protected |
Definition at line 57 of file SocketWrapper.php.
Referenced by setDeadline().
|
protected |
Definition at line 51 of file SocketWrapper.php.
|
protected |
Definition at line 63 of file SocketWrapper.php.
Referenced by HTTP_Request2_SOCKS5\__construct(), __construct(), and setDeadline().