PHP Class PHPDaemon\Network\Server

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

Méthodes publiques

Свойство Type Description
$allowedClients Allowed clients

Protected Properties

Свойство Type Description
$bound Bound sockets

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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 méthode

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

applyConfig() protected méthode

Applies config
protected applyConfig ( ) : void
Résultat void

attachBound() public méthode

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

bindSocket() public méthode

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

bindSockets() public méthode

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

closeBound() public méthode

Close each of binded sockets
public closeBound ( ) : void
Résultat void

detachBound() public méthode

Detach Generic
public detachBound ( Generic $bound ) : void
$bound PHPDaemon\BoundSocket\Generic Generic
Résultat void

inheritFromRequest() public méthode

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

onDisable() protected méthode

Called when ConnectionPool is now disabled
protected onDisable ( ) : void
Résultat void

onEnable() protected méthode

Called when ConnectionPool is now enabled
protected onEnable ( ) : void
Résultat void

onFinish() protected méthode

Called when ConnectionPool is finished
protected onFinish ( ) : void
Résultat void

Property Details

$allowedClients public_oe property

Allowed clients
public $allowedClients

$bound protected_oe property

Bound sockets
protected $bound