PHP Class PHPDaemon\Servers\WebSocket\Pool

Inheritance: extends PHPDaemon\Network\Server, use trait PHPDaemon\Traits\EventHandlers
Afficher le fichier Open project: kakserpom/phpdaemon Class Usage Examples

Méthodes publiques

Свойство Type Description
$routes array

Méthodes publiques

Méthode Description
addRoute ( string $path, callable $cb ) : boolean Adds a route if it doesn't exist already.
getRoute ( string $path, object $client, boolean $withoutCustomTransport = false ) : mixed
getRouteOptions ( string $path ) : array Return options by route
removeRoute ( string $path ) : boolean Removes a route.
routeExists ( string $path ) : boolean Checks if route exists
setRoute ( string $path, callable $cb ) : boolean Force add/replace a route.
setRouteOptions ( string $path, array $opts ) : boolean Sets an array of options associated to the route

Méthodes protégées

Méthode Description
getConfigDefaults ( ) : array | boolean Setting default config options Overriden from ConnectionPool::getConfigDefaults

Method Details

addRoute() public méthode

Adds a route if it doesn't exist already.
public addRoute ( string $path, callable $cb ) : boolean
$path string Route name.
$cb callable Route's callback.
Résultat boolean Success.

getConfigDefaults() protected méthode

Setting default config options Overriden from ConnectionPool::getConfigDefaults
protected getConfigDefaults ( ) : array | boolean
Résultat array | boolean

getRoute() public méthode

public getRoute ( string $path, object $client, boolean $withoutCustomTransport = false ) : mixed
$path string
$client object
$withoutCustomTransport boolean
Résultat mixed

getRouteOptions() public méthode

Return options by route
public getRouteOptions ( string $path ) : array
$path string Route name
Résultat array Options

removeRoute() public méthode

Removes a route.
public removeRoute ( string $path ) : boolean
$path string Route name
Résultat boolean Success

routeExists() public méthode

Checks if route exists
public routeExists ( string $path ) : boolean
$path string Route name
Résultat boolean Exists?

setRoute() public méthode

Force add/replace a route.
public setRoute ( string $path, callable $cb ) : boolean
$path string Path
$cb callable Callback
Résultat boolean Success

setRouteOptions() public méthode

Sets an array of options associated to the route
public setRouteOptions ( string $path, array $opts ) : boolean
$path string Route name.
$opts array Options
Résultat boolean Success.

Property Details

$routes public_oe property

public array $routes
Résultat array