PHP 클래스 PHPDaemon\WebSocket\Route

저자: Vasily Zorin ([email protected])
상속: implements PHPDaemon\WebSocket\RouteInterface, use trait PHPDaemon\Traits\StaticObjectWatchdog, use trait PHPDaemon\Traits\Sessions, use trait PHPDaemon\Traits\DeferredEventHandlers
파일 보기 프로젝트 열기: kakserpom/phpdaemon 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$appInstance PHPDaemon\Core\AppInstance
$attrs
$client PHPDaemon\Servers\WebSocket\Connection

보호된 프로퍼티들

프로퍼티 타입 설명
$running

공개 메소드들

메소드 설명
__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

보호된 메소드들

메소드 설명
getCookieStr ( string $name ) : string Get cookie by name
getSessionState ( ) : mixed Get session state
setSessionState ( mixed $var ) : void Set session state

메소드 상세

__construct() 공개 메소드

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

getCookieStr() 보호된 메소드

Get cookie by name
protected getCookieStr ( string $name ) : string
$name string Name of cookie
리턴 string Contents

getSessionState() 보호된 메소드

Get session state
protected getSessionState ( ) : mixed
리턴 mixed

gracefulShutdown() 공개 메소드

Called when the worker is going to shutdown.
public gracefulShutdown ( ) : boolean
리턴 boolean Ready to shutdown?

handleException() 공개 메소드

Uncaught exception handler
public handleException ( $e ) : boolean
$e
리턴 boolean Handled?

onFinish() 공개 메소드

Called when session finished.
public onFinish ( ) : void
리턴 void

onFrame() 공개 메소드

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

onHandshake() 공개 메소드

Called when the connection is handshaked.
public onHandshake ( ) : void
리턴 void

onSleep() 공개 메소드

Called when the request starts sleep
public onSleep ( ) : void
리턴 void

onWakeup() 공개 메소드

Called when the request wakes up
public onWakeup ( ) : void
리턴 void

setSessionState() 보호된 메소드

Set session state
protected setSessionState ( mixed $var ) : void
$var mixed
리턴 void

setcookie() 공개 메소드

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.
리턴 void

프로퍼티 상세

$appInstance 공개적으로 프로퍼티

public AppInstance,PHPDaemon\Core $appInstance
리턴 PHPDaemon\Core\AppInstance

$attrs 공개적으로 프로퍼티

public $attrs

$client 공개적으로 프로퍼티

public Connection,PHPDaemon\Servers\WebSocket $client
리턴 PHPDaemon\Servers\WebSocket\Connection

$running 보호되어 있는 프로퍼티

protected $running