\Psc\Library\Net\WebSocket\ServerConnection

Summary

Methods
Properties
Constants
__construct()
push()
send()
close()
isHandshake()
getId()
getHeaderContent()
onMessage()
onConnect()
onClose()
$buffer
$stream
No constants found
No protected methods found
No protected properties found
N/A
handleRead()
build()
parse()
$headerContent
$step
$onMessage
$onConnect
$onClose
N/A

Properties

$buffer

$buffer : string

Type

string

$stream

$stream : \Psc\Core\Stream\Stream

Type

Stream

$headerContent

$headerContent : string

Type

string

$step

$step : int

Type

int

$onMessage

$onMessage : \Closure|null

Type

Closure|null

$onConnect

$onConnect : \Closure|null

Type

Closure|null

Methods

__construct()

__construct(\Psc\Core\Stream\Stream  $stream) : mixed

Parameters

\Psc\Core\Stream\Stream $stream

Returns

mixed —

push()

push(string  $data) : void

Parameters

string $data

Throws

\Psc\Std\Stream\Exception\ConnectionException

send()

send(string  $message) : bool

Parameters

string $message

Returns

bool —

close()

close() : void

isHandshake()

isHandshake() : bool

Returns

bool —

getId()

getId() : int

Returns

int —

getHeaderContent()

getHeaderContent() : string

Returns

string —

onMessage()

onMessage(\Closure  $onMessage) : void

Parameters

\Closure $onMessage

onConnect()

onConnect(\Closure  $onConnect) : void

Parameters

\Closure $onConnect

onClose()

onClose(\Closure  $onClose) : void

Parameters

\Closure $onClose

handleRead()

handleRead(\Psc\Core\Stream\Stream  $stream) : void

Parameters

\Psc\Core\Stream\Stream $stream

build()

build(string  $context, int  $opcode = 0x1, bool  $fin = true) : string

Parameters

string $context
int $opcode
bool $fin

Returns

string —

parse()

parse() : array

Returns

array —