PHP Класс Workerman\Connection\AsyncTcpConnection

Наследование: extends TcpConnection
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$onConnect callback Emitted when socket connection is successfully established.
$transport string Transport layer protocol.

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

Свойство Тип Описание
$_builtinTransports array PHP built-in protocols.
$_connectStartTime string Connect start time.
$_contextOption resource Context option.
$_reconnectTimer integer Reconnect timer.
$_remoteHost string Remote host.
$_remoteURI string Remote URI.
$_status integer Status.

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

Метод Описание
__construct ( string $remote_address, array $context_option = null ) Construct.
checkConnection ( resource $socket ) : void Check connection is successfully established or faild.
connect ( ) : void Do connect.
getRemoteHost ( ) : string Get remote address.
getRemoteURI ( ) : string Get remote URI.
reConnect ( integer $after ) : void Reconnect.

Защищенные методы

Метод Описание
emitError ( integer $code, string $msg ) : void Try to emit onError callback.

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

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

Construct.
public __construct ( string $remote_address, array $context_option = null )
$remote_address string
$context_option array

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

Check connection is successfully established or faild.
public checkConnection ( resource $socket ) : void
$socket resource
Результат void

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

Do connect.
public connect ( ) : void
Результат void

emitError() защищенный метод

Try to emit onError callback.
protected emitError ( integer $code, string $msg ) : void
$code integer
$msg string
Результат void

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

Get remote address.
public getRemoteHost ( ) : string
Результат string

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

Get remote URI.
public getRemoteURI ( ) : string
Результат string

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

Reconnect.
public reConnect ( integer $after ) : void
$after integer
Результат void

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

$_builtinTransports защищенное статическое свойство

PHP built-in protocols.
protected static array $_builtinTransports
Результат array

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

Connect start time.
protected string $_connectStartTime
Результат string

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

Context option.
protected resource $_contextOption
Результат resource

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

Reconnect timer.
protected int $_reconnectTimer
Результат integer

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

Remote host.
protected string $_remoteHost
Результат string

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

Remote URI.
protected string $_remoteURI
Результат string

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

Status.
protected int $_status
Результат integer

$onConnect публичное свойство

Emitted when socket connection is successfully established.
public callback $onConnect
Результат callback

$transport публичное свойство

Transport layer protocol.
public string $transport
Результат string