PHP Класс LdapTools\Utilities\TcpSocket

Автор: Chad Sikorra ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$options array
$socket boolean | resource

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный метод

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

close() публичный метод

Close the connection to the host.
public close ( )

connect() публичный метод

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
Результат boolean

enableEncryption() публичный метод

Enable encryption for the socket connection.
public enableEncryption ( integer $cryptoMethod = null ) : boolean
$cryptoMethod integer
Результат boolean

getParams() публичный метод

Get parameter/option information from the TCP socket stream/context.
public getParams ( ) : array
Результат array

read() публичный метод

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

setOperationTimeout() публичный метод

Sets the timeout (in seconds) for TCP operations (not the initial connection attempt).
public setOperationTimeout ( integer $timeout ) : boolean
$timeout integer
Результат boolean

write() публичный метод

Write data to the TCP socket.
public write ( mixed $data ) : integer
$data mixed
Результат integer

Описание свойств

$options защищенное свойство

protected array $options
Результат array

$socket защищенное свойство

protected bool|resource $socket
Результат boolean | resource