PHP Class PHPDaemon\Network\ClientConnection

Author: Vasily Zorin ([email protected])
Inheritance: extends Connection
ファイルを表示 Open project: kakserpom/phpdaemon Class Usage Examples

Protected Properties

Property Type Description
$acquired Acquired?
$busy Busy?
$maxQueue
$noSAF No Send-and-Forget?
$onResponse Stack of onResponse callbacks
$timeout Timeout

Public Methods

Method Description
__construct ( resource $fd, mixed $pool = null ) Constructor
acquire ( ) : void Acquire the connection
checkFree ( ) : void Set connection free/busy according to onResponse emptiness and ->finished
getQueueLength ( ) : integer getQueueLength
isBusy ( ) : boolean Busy?
isQueueEmpty ( ) : boolean isQueueEmpty
onFinish ( ) : void Called when connection finishes
onReady ( ) : void Called when the connection is handshaked (at low-level), and peer is ready to recv. data
onResponse ( callable $cb ) : void Push callback to onReponse stack
release ( ) : void Release the connection
setFree ( boolean $free = true ) : void Set connection free/busy

Method Details

__construct() public method

Constructor
public __construct ( resource $fd, mixed $pool = null )
$fd resource File descriptor
$pool mixed ConnectionPool

acquire() public method

Acquire the connection
public acquire ( ) : void
return void

checkFree() public method

Set connection free/busy according to onResponse emptiness and ->finished
public checkFree ( ) : void
return void

getQueueLength() public method

getQueueLength
public getQueueLength ( ) : integer
return integer

isBusy() public method

Busy?
public isBusy ( ) : boolean
return boolean

isQueueEmpty() public method

isQueueEmpty
public isQueueEmpty ( ) : boolean
return boolean

onFinish() public method

Called when connection finishes
public onFinish ( ) : void
return void

onReady() public method

Called when the connection is handshaked (at low-level), and peer is ready to recv. data
public onReady ( ) : void
return void

onResponse() public method

Push callback to onReponse stack
public onResponse ( callable $cb ) : void
$cb callable Callback
return void

release() public method

Release the connection
public release ( ) : void
return void

setFree() public method

Set connection free/busy
public setFree ( boolean $free = true ) : void
$free boolean Free?
return void

Property Details

$acquired protected_oe property

Acquired?
protected $acquired

$busy protected_oe property

Busy?
protected $busy

$maxQueue protected_oe property

protected $maxQueue

$noSAF protected_oe property

No Send-and-Forget?
protected $noSAF

$onResponse protected_oe property

Stack of onResponse callbacks
protected $onResponse

$timeout protected_oe property

Timeout
protected $timeout