Property | Type | Description | |
---|---|---|---|
$_connected | boolean | Is there an active connection? | |
$_params | array | Configuration parameters. | |
$_secure | boolean | Is the connection secure? | |
$_stream | resource | The actual socket. |
Method | Description | |
---|---|---|
__clone ( ) | This object can not be cloned. | |
__construct ( string $host, integer $port = null, integer $timeout = 30, mixed $secure = false, array $context = [], array $params = [] ) | Constructor. | |
__get ( $name ) | ||
__sleep ( ) | This object can not be serialized. | |
close ( ) | Close the connection. | |
getStatus ( ) : array | Returns information about the connection. | |
gets ( integer $size ) : string | Returns a line of data. | |
read ( integer $size ) : string | Returns a specified amount of data. | |
startTls ( ) : boolean | Start a TLS connection. | |
write ( string $data ) | Writes data to the stream. |
Method | Description | |
---|---|---|
_checkStream ( ) | Throws an exception is the stream is not a resource. | |
_connect ( $host, $port, $timeout, $secure, $context, $retries ) | Connect to the remote server. |
public __construct ( string $host, integer $port = null, integer $timeout = 30, mixed $secure = false, array $context = [], array $params = [] ) | ||
$host | string | Hostname of remote server (can contain protocol prefx). |
$port | integer | Port number of remote server. |
$timeout | integer | Connection timeout (in seconds). |
$secure | mixed | Security layer requested. One of: - false: (No encryption) [DEFAULT] - 'ssl': (Auto-detect SSL version) - 'sslv2': (Force SSL version 3) - 'sslv3': (Force SSL version 2) - 'tls': (TLS; started via protocol-level negotation over unencrypted channel) - 'tlsv1': (TLS version 1.x connection) - true: (TLS if available/necessary) |
$context | array | Any context parameters passed to stream_create_context(). |
$params | array | Additional options. |
protected _checkStream ( ) |
protected _connect ( $host, $port, $timeout, $secure, $context, $retries ) |
protected bool $_connected | ||
return | boolean |