PHP Class PHPDaemon\WebSocket\Route

Author: Vasily Zorin ([email protected])
Inheritance: implements PHPDaemon\WebSocket\RouteInterface, use trait PHPDaemon\Traits\StaticObjectWatchdog, use trait PHPDaemon\Traits\Sessions, use trait PHPDaemon\Traits\DeferredEventHandlers
Afficher le fichier Open project: kakserpom/phpdaemon Class Usage Examples

Méthodes publiques

Свойство Type Description
$appInstance PHPDaemon\Core\AppInstance
$attrs
$client PHPDaemon\Servers\WebSocket\Connection

Protected Properties

Свойство Type Description
$running

Méthodes publiques

Méthode Description
__construct ( Connection $client, AppInstance $appInstance = null ) Called when client connected.
gracefulShutdown ( ) : boolean Called when the worker is going to shutdown.
handleException ( $e ) : boolean Uncaught exception handler
onFinish ( ) : void Called when session finished.
onFrame ( string $data, integer $type ) : void Called when new frame is received
onHandshake ( ) : void Called when the connection is handshaked.
onSleep ( ) : void Called when the request starts sleep
onWakeup ( ) : void Called when the request wakes up
setcookie ( string $name, string $value = '', integer $maxage, string $path = '', string $domain = '', boolean $secure = false, boolean $HTTPOnly = false ) : void Set the cookie

Méthodes protégées

Méthode Description
getCookieStr ( string $name ) : string Get cookie by name
getSessionState ( ) : mixed Get session state
setSessionState ( mixed $var ) : void Set session state

Method Details

__construct() public méthode

Called when client connected.
public __construct ( Connection $client, AppInstance $appInstance = null )
$client PHPDaemon\Servers\WebSocket\Connection Remote client
$appInstance PHPDaemon\Core\AppInstance

getCookieStr() protected méthode

Get cookie by name
protected getCookieStr ( string $name ) : string
$name string Name of cookie
Résultat string Contents

getSessionState() protected méthode

Get session state
protected getSessionState ( ) : mixed
Résultat mixed

gracefulShutdown() public méthode

Called when the worker is going to shutdown.
public gracefulShutdown ( ) : boolean
Résultat boolean Ready to shutdown?

handleException() public méthode

Uncaught exception handler
public handleException ( $e ) : boolean
$e
Résultat boolean Handled?

onFinish() public méthode

Called when session finished.
public onFinish ( ) : void
Résultat void

onFrame() public méthode

Called when new frame is received
public onFrame ( string $data, integer $type ) : void
$data string Frame's contents
$type integer Frame's type
Résultat void

onHandshake() public méthode

Called when the connection is handshaked.
public onHandshake ( ) : void
Résultat void

onSleep() public méthode

Called when the request starts sleep
public onSleep ( ) : void
Résultat void

onWakeup() public méthode

Called when the request wakes up
public onWakeup ( ) : void
Résultat void

setSessionState() protected méthode

Set session state
protected setSessionState ( mixed $var ) : void
$var mixed
Résultat void

setcookie() public méthode

Set the cookie
public setcookie ( string $name, string $value = '', integer $maxage, string $path = '', string $domain = '', boolean $secure = false, boolean $HTTPOnly = false ) : void
$name string Name of cookie
$value string Value
$maxage integer Optional. Max-Age. Default is 0.
$path string Optional. Path. Default is empty string.
$domain string Optional. Domain. Default is empty string.
$secure boolean Optional. Secure. Default is false.
$HTTPOnly boolean Optional. HTTPOnly. Default is false.
Résultat void

Property Details

$appInstance public_oe property

public AppInstance,PHPDaemon\Core $appInstance
Résultat PHPDaemon\Core\AppInstance

$attrs public_oe property

public $attrs

$client public_oe property

public Connection,PHPDaemon\Servers\WebSocket $client
Résultat PHPDaemon\Servers\WebSocket\Connection

$running protected_oe property

protected $running