Documentation

FrameHandler
in package
implements LoggerAwareInterface, Stringable uses OpcodeTrait, StringableTrait

WebSocket\Frame\FrameHandler class.

Reads and writes Frames on stream.

Table of Contents

Interfaces

LoggerAwareInterface
Describes a logger-aware instance.
Stringable

Properties

$logger  : LoggerInterface
$opcodes  : array<string|int, mixed>
$pullMaskedRequired  : bool
$pushMasked  : bool
$stream  : SocketStream

Methods

__construct()  : mixed
__toString()  : string
pull()  : Frame
push()  : int
setLogger()  : void
Sets a logger instance on the object.
stringable()  : string
read()  : string
write()  : int

Properties

$opcodes

private static array<string|int, mixed> $opcodes = ['continuation' => 0, 'text' => 1, 'binary' => 2, 'close' => 8, 'ping' => 9, 'pong' => 10]

Methods

__construct()

public __construct(SocketStream $stream, bool $pushMasked, bool $pullMaskedRequired) : mixed
Parameters
$stream : SocketStream
$pushMasked : bool
$pullMaskedRequired : bool

push()

public push(Frame $frame[, bool|null $masked = null ]) : int
Parameters
$frame : Frame
$masked : bool|null = null
Return values
int

stringable()

protected stringable(string $format, mixed ...$values) : string
Parameters
$format : string
$values : mixed
Return values
string

read()

private read(int $length) : string
Parameters
$length : int
Return values
string

write()

private write(string $data) : int
Parameters
$data : string
Return values
int

        
On this page

Search results