PHP Class Workerman\Connection\AsyncTcpConnection

Inheritance: extends TcpConnection
Exibir arquivo Open project: walkor/workerman Class Usage Examples

Public Properties

Property Type Description
$onConnect callback Emitted when socket connection is successfully established.
$transport string Transport layer protocol.

Protected Properties

Property Type Description
$_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.

Public Methods

Method Description
__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.

Protected Methods

Method Description
emitError ( integer $code, string $msg ) : void Try to emit onError callback.

Method Details

__construct() public method

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

checkConnection() public method

Check connection is successfully established or faild.
public checkConnection ( resource $socket ) : void
$socket resource
return void

connect() public method

Do connect.
public connect ( ) : void
return void

emitError() protected method

Try to emit onError callback.
protected emitError ( integer $code, string $msg ) : void
$code integer
$msg string
return void

getRemoteHost() public method

Get remote address.
public getRemoteHost ( ) : string
return string

getRemoteURI() public method

Get remote URI.
public getRemoteURI ( ) : string
return string

reConnect() public method

Reconnect.
public reConnect ( integer $after ) : void
$after integer
return void

Property Details

$_builtinTransports protected_oe static_oe property

PHP built-in protocols.
protected static array $_builtinTransports
return array

$_connectStartTime protected_oe property

Connect start time.
protected string $_connectStartTime
return string

$_contextOption protected_oe property

Context option.
protected resource $_contextOption
return resource

$_reconnectTimer protected_oe property

Reconnect timer.
protected int $_reconnectTimer
return integer

$_remoteHost protected_oe property

Remote host.
protected string $_remoteHost
return string

$_remoteURI protected_oe property

Remote URI.
protected string $_remoteURI
return string

$_status protected_oe property

Status.
protected int $_status
return integer

$onConnect public_oe property

Emitted when socket connection is successfully established.
public callback $onConnect
return callback

$transport public_oe property

Transport layer protocol.
public string $transport
return string