PHP Class PHPDaemon\Network\Server

Author: Vasily Zorin ([email protected])
Inheritance: extends Pool
Datei anzeigen Open project: kakserpom/phpdaemon Class Usage Examples

Public Properties

Property Type Description
$allowedClients Allowed clients

Protected Properties

Property Type Description
$bound Bound sockets

Public Methods

Method Description
__construct ( array $config = [], boolean $init = true ) Constructor
attachBound ( Generic $bound, mixed $inf = null ) : void Attach Generic
bindSocket ( string $uri ) : boolean Bind given socket
bindSockets ( mixed $addrs = [], integer $max ) : integer Bind given sockets
closeBound ( ) : void Close each of binded sockets
detachBound ( Generic $bound ) : void Detach Generic
inheritFromRequest ( object $req, object $oldConn ) : boolean Called when a request to HTTP-server looks like another connection

Protected Methods

Method Description
applyConfig ( ) : void Applies config
onDisable ( ) : void Called when ConnectionPool is now disabled
onEnable ( ) : void Called when ConnectionPool is now enabled
onFinish ( ) : void Called when ConnectionPool is finished

Method Details

__construct() public method

Constructor
public __construct ( array $config = [], boolean $init = true )
$config array Config variables
$init boolean

applyConfig() protected method

Applies config
protected applyConfig ( ) : void
return void

attachBound() public method

Attach Generic
public attachBound ( Generic $bound, mixed $inf = null ) : void
$bound PHPDaemon\BoundSocket\Generic Generic
$inf mixed Info
return void

bindSocket() public method

Bind given socket
public bindSocket ( string $uri ) : boolean
$uri string Address to bind
return boolean Success

bindSockets() public method

Bind given sockets
public bindSockets ( mixed $addrs = [], integer $max ) : integer
$addrs mixed Addresses to bind
$max integer Maximum
return integer Number of bound

closeBound() public method

Close each of binded sockets
public closeBound ( ) : void
return void

detachBound() public method

Detach Generic
public detachBound ( Generic $bound ) : void
$bound PHPDaemon\BoundSocket\Generic Generic
return void

inheritFromRequest() public method

Called when a request to HTTP-server looks like another connection
public inheritFromRequest ( object $req, object $oldConn ) : boolean
$req object Request
$oldConn object Connection
return boolean Success

onDisable() protected method

Called when ConnectionPool is now disabled
protected onDisable ( ) : void
return void

onEnable() protected method

Called when ConnectionPool is now enabled
protected onEnable ( ) : void
return void

onFinish() protected method

Called when ConnectionPool is finished
protected onFinish ( ) : void
return void

Property Details

$allowedClients public_oe property

Allowed clients
public $allowedClients

$bound protected_oe property

Bound sockets
protected $bound