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
$logger
private
LoggerInterface
$logger
$opcodes
private
static array<string|int, mixed>
$opcodes
= ['continuation' => 0, 'text' => 1, 'binary' => 2, 'close' => 8, 'ping' => 9, 'pong' => 10]
$pullMaskedRequired
private
bool
$pullMaskedRequired
$pushMasked
private
bool
$pushMasked
$stream
private
SocketStream
$stream
Methods
__construct()
public
__construct(SocketStream $stream, bool $pushMasked, bool $pullMaskedRequired) : mixed
Parameters
- $stream : SocketStream
- $pushMasked : bool
- $pullMaskedRequired : bool
__toString()
public
__toString() : string
Return values
stringpull()
public
pull() : Frame
Return values
Framepush()
public
push(Frame $frame[, bool|null $masked = null ]) : int
Parameters
- $frame : Frame
- $masked : bool|null = null
Return values
intsetLogger()
Sets a logger instance on the object.
public
setLogger(LoggerInterface $logger) : void
Parameters
- $logger : LoggerInterface
stringable()
protected
stringable(string $format, mixed ...$values) : string
Parameters
- $format : string
- $values : mixed
Return values
stringread()
private
read(int $length) : string
Parameters
- $length : int
Return values
stringwrite()
private
write(string $data) : int
Parameters
- $data : string