PHP 클래스 PHPDaemon\Servers\WebSocket\Connection

상속: extends PHPDaemon\Network\Connection, use trait PHPDaemon\Traits\DeferredEventHandlers, use trait PHPDaemon\Traits\Sessions
파일 보기 프로젝트 열기: kakserpom/phpdaemon 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$cookie _COOKIE
$get _GET
$hvaltr Replacement pairs for processing some header values in parse_str()
$server _SERVER

보호된 프로퍼티들

프로퍼티 타입 설명
$EOL
$contentLength Content length from header() method
$cookieNum Number of outgoing cookie-headers
$currentHeader
$extensions
$extensionsCleanRegex
$handshaked
$headers
$headers_sent
$policyReqNotFound
$route
$running Is this connection running right now?
$timeout Timeout
$writeReady

공개 메소드들

메소드 설명
badRequest ( ) : void Send Bad request
getFrameType ( $type ) : integer Get real frame type identificator
gracefulShutdown ( ) : boolean Called when the worker is going to shutdown.
handleException ( Exception $e ) : boolean Uncaught exception handler
handshake ( ) : boolean Called when we're going to handshake.
header ( string $s, boolean $replace = true, boolean $code = false ) : boolean Send the header
onFinish ( ) : void Event of Connection.
onFrame ( string $data, string $type ) : boolean Called when new frame received.
onInheritance ( $conn )
onInheritanceFromRequest ( object $req ) : void Called when connection is inherited from HTTP request
onReady ( ) : void Called when the stream is handshaked (at low-level), and peer is ready to recv. data
sendFrame ( string $data, string $type = null, callable $cb = null ) : boolean Sends a frame.
status ( integer $code = 200 ) : boolean Send HTTP-status

보호된 메소드들

메소드 설명
handshakeAfter ( )
httpProcessHeaders ( ) : boolean Process headers
httpReadFirstline ( ) : boolean | null Read first line of HTTP request
httpReadHeaders ( ) : boolean | null Read headers line-by-line
onRead ( ) : void Called when new data received.
switchToProtocol ( $proto )

메소드 상세

badRequest() 공개 메소드

Send Bad request
public badRequest ( ) : void
리턴 void

getFrameType() 공개 메소드

Get real frame type identificator
public getFrameType ( $type ) : integer
$type
리턴 integer

gracefulShutdown() 공개 메소드

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

handleException() 공개 메소드

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

handshake() 공개 메소드

Called when we're going to handshake.
public handshake ( ) : boolean
리턴 boolean Handshake status

handshakeAfter() 보호된 메소드

protected handshakeAfter ( )

header() 공개 메소드

Send the header
public header ( string $s, boolean $replace = true, boolean $code = false ) : boolean
$s string Header. Example: 'Location: http://php.net/'
$replace boolean Optional. Replace?
$code boolean Optional. HTTP response code
리턴 boolean Success

httpProcessHeaders() 보호된 메소드

Process headers
protected httpProcessHeaders ( ) : boolean
리턴 boolean

httpReadFirstline() 보호된 메소드

Read first line of HTTP request
protected httpReadFirstline ( ) : boolean | null
리턴 boolean | null Success

httpReadHeaders() 보호된 메소드

Read headers line-by-line
protected httpReadHeaders ( ) : boolean | null
리턴 boolean | null Success

onFinish() 공개 메소드

Event of Connection.
public onFinish ( ) : void
리턴 void

onFrame() 공개 메소드

Called when new frame received.
public onFrame ( string $data, string $type ) : boolean
$data string Frame's data.
$type string Frame's type ("STRING" OR "BINARY").
리턴 boolean Success.

onInheritance() 공개 메소드

public onInheritance ( $conn )

onInheritanceFromRequest() 공개 메소드

Called when connection is inherited from HTTP request
public onInheritanceFromRequest ( object $req ) : void
$req object
리턴 void

onRead() 보호된 메소드

Called when new data received.
protected onRead ( ) : void
리턴 void

onReady() 공개 메소드

Called when the stream is handshaked (at low-level), and peer is ready to recv. data
public onReady ( ) : void
리턴 void

sendFrame() 공개 메소드

Sends a frame.
public sendFrame ( string $data, string $type = null, callable $cb = null ) : boolean
$data string Frame's data.
$type string Frame's type. ("STRING" OR "BINARY")
$cb callable Optional. Callback called when the frame is received by client.
리턴 boolean Success.

status() 공개 메소드

Send HTTP-status
public status ( integer $code = 200 ) : boolean
$code integer Code
리턴 boolean Success

switchToProtocol() 보호된 메소드

protected switchToProtocol ( $proto )

프로퍼티 상세

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

protected $EOL

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

Content length from header() method
protected $contentLength

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

Number of outgoing cookie-headers
protected $cookieNum

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

protected $currentHeader

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

protected $extensions

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

protected $extensionsCleanRegex

$get 공개적으로 프로퍼티

_GET
public $get

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

protected $handshaked

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

protected $headers

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

protected $headers_sent

$hvaltr 공개적으로 정적으로 프로퍼티

Replacement pairs for processing some header values in parse_str()
public static $hvaltr

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

protected $policyReqNotFound

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

protected $route

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

Is this connection running right now?
protected $running

$server 공개적으로 프로퍼티

_SERVER
public $server

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

Timeout
protected $timeout

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

protected $writeReady