\Psc\Library\Net\WebSocket\ClientConnection

[协议相关] 白皮书: https://datatracker.ietf.org/doc/html/rfc6455 最新规范: https://websockets.spec.whatwg.org/

Summary

Methods
Properties
Constants
__construct()
send()
onConnect()
onMessage()
onClose()
onError()
onOpen()
close()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_handshake()
_close()
_open()
_error()
_message()
$onOpen
$onMessage
$onClose
$onError
$stream
$buffer
$address
$timeout
$context
N/A

Properties

$onOpen

$onOpen : \Closure

Type

\Closure —

$onMessage

$onMessage : \Closure

Type

\Closure —

$onClose

$onClose : \Closure

Type

\Closure —

$onError

$onError : \Closure

Type

\Closure —

$stream

$stream : \Psc\Core\Stream\Stream

Type

Stream

$buffer

$buffer : string

Type

string

$address

$address : string

Type

string

$timeout

$timeout : int|float

Type

int|float

$context

$context : mixed

Type

mixed

Methods

__construct()

__construct(string  $address, int|float  $timeout = 10, mixed|null  $context = null) : mixed

Parameters

string $address
int|float $timeout
mixed|null $context

Returns

mixed —

send()

send(string  $data) : void

Parameters

string $data

Throws

\Psc\Std\Stream\Exception\ConnectionException|\Throwable

onConnect()

onConnect(\Closure  $onOpen) : void

Parameters

\Closure $onOpen

onMessage()

onMessage(\Closure  $onMessage) : void

Parameters

\Closure $onMessage

onClose()

onClose(\Closure  $onClose) : void

Parameters

\Closure $onClose

onError()

onError(\Closure  $onError) : void

Parameters

\Closure $onError

onOpen()

onOpen(\Closure  $onOpen) : void

Parameters

\Closure $onOpen

close()

close() : void

_handshake()

_handshake() : \Psc\Core\Coroutine\Promise

Returns

\Psc\Core\Coroutine\Promise —

_close()

_close() : void

_open()

_open() : void

_error()

_error(\Throwable  $e) : void

Parameters

\Throwable $e

_message()

_message(string  $unmaskedData, int  $opcode) : void

Parameters

string $unmaskedData
int $opcode