PHP Class LdapTools\Utilities\TcpSocket

Author: Chad Sikorra ([email protected])
Afficher le fichier Open project: ldaptools/ldaptools Class Usage Examples

Protected Properties

Свойство Type Description
$options array
$socket boolean | resource

Méthodes publiques

Méthode Description
__construct ( array $options = [] )
close ( ) Close the connection to the host.
connect ( string $host, integer $port, integer $timeout = 1 ) : boolean Connect to the host on the port defined for this TCP socket.
enableEncryption ( integer $cryptoMethod = null ) : boolean Enable encryption for the socket connection.
getParams ( ) : array Get parameter/option information from the TCP socket stream/context.
read ( integer $length ) Read data from the TCP socket.
setOperationTimeout ( integer $timeout ) : boolean Sets the timeout (in seconds) for TCP operations (not the initial connection attempt).
write ( mixed $data ) : integer Write data to the TCP socket.

Method Details

__construct() public méthode

public __construct ( array $options = [] )
$options array The TCP stream context options.

close() public méthode

Close the connection to the host.
public close ( )

connect() public méthode

Connect to the host on the port defined for this TCP socket.
public connect ( string $host, integer $port, integer $timeout = 1 ) : boolean
$host string
$port integer
$timeout integer
Résultat boolean

enableEncryption() public méthode

Enable encryption for the socket connection.
public enableEncryption ( integer $cryptoMethod = null ) : boolean
$cryptoMethod integer
Résultat boolean

getParams() public méthode

Get parameter/option information from the TCP socket stream/context.
public getParams ( ) : array
Résultat array

read() public méthode

Read data from the TCP socket.
public read ( integer $length )
$length integer

setOperationTimeout() public méthode

Sets the timeout (in seconds) for TCP operations (not the initial connection attempt).
public setOperationTimeout ( integer $timeout ) : boolean
$timeout integer
Résultat boolean

write() public méthode

Write data to the TCP socket.
public write ( mixed $data ) : integer
$data mixed
Résultat integer

Property Details

$options protected_oe property

protected array $options
Résultat array

$socket protected_oe property

protected bool|resource $socket
Résultat boolean | resource