Documentation

MessageBuffer
in package

Table of Contents

Properties

$checkForMask  : bool
$closeFrameChecker  : CloseFrameChecker
$compressedMessage  : bool
$deflateEnabled  : bool
$deflator  : resource|bool|null
$exceptionFactory  : callable
$frameBuffer  : FrameInterface|null
$inflator  : resource|bool|null
$leftovers  : string
$maxFramePayloadSize  : int
$maxMessagePayloadSize  : int
$messageBuffer  : MessageInterface|null
$onControl  : callable
$onMessage  : callable
$permessageDeflateOptions  : PermessageDeflateOptions
$sender  : callable
$streamingMessageOpCode  : int

Methods

__construct()  : mixed
checkMessage()  : bool|int
Determine if a message is valid
frameCheck()  : FrameInterface
Check a frame to be added to the current message buffer
newCloseFrame()  : FrameInterface
newFrame()  : FrameInterface
newMessage()  : MessageInterface
onData()  : void
sendFrame()  : void
sendMessage()  : void
checkUtf8()  : bool
deflateFrame()  : FrameInterface
getDeflateNoContextTakeover()  : bool|null
getDeflateWindowBits()  : int
getInflateNoContextTakeover()  : bool|null
getInflateWindowBits()  : int
getMemoryLimit()  : int
This is a separate function for testing purposes $memory_limit is only used for testing
inflateFrame()  : Frame
processData()  : void

Properties

$streamingMessageOpCode

private int $streamingMessageOpCode = -1

Methods

__construct()

public __construct(CloseFrameChecker $frameChecker, callable $onMessage[, callable|null $onControl = null ][, bool $expectMask = true ][, callable|null $exceptionFactory = null ][, int|null $maxMessagePayloadSize = null ][, int|null $maxFramePayloadSize = null ][, callable|null $sender = null ][, PermessageDeflateOptions|null $permessageDeflateOptions = null ]) : mixed
Parameters
$frameChecker : CloseFrameChecker
$onMessage : callable
$onControl : callable|null = null
$expectMask : bool = true
$exceptionFactory : callable|null = null
$maxMessagePayloadSize : int|null = null
$maxFramePayloadSize : int|null = null
$sender : callable|null = null
$permessageDeflateOptions : PermessageDeflateOptions|null = null

checkMessage()

Determine if a message is valid

public checkMessage(MessageInterface $message) : bool|int
Parameters
$message : MessageInterface
Return values
bool|int —

true if valid - false if incomplete - int of recommended close code

onData()

public onData(string $data) : void
Parameters
$data : string

sendMessage()

public sendMessage(string $messagePayload[, bool $final = true ][, bool $isBinary = false ]) : void
Parameters
$messagePayload : string
$final : bool = true
$isBinary : bool = false

checkUtf8()

private checkUtf8(string $string) : bool
Parameters
$string : string
Return values
bool

getDeflateNoContextTakeover()

private getDeflateNoContextTakeover() : bool|null
Return values
bool|null

getDeflateWindowBits()

private getDeflateWindowBits() : int
Return values
int

getInflateNoContextTakeover()

private getInflateNoContextTakeover() : bool|null
Return values
bool|null

getInflateWindowBits()

private getInflateWindowBits() : int
Return values
int

getMemoryLimit()

This is a separate function for testing purposes $memory_limit is only used for testing

private static getMemoryLimit([null|string $memory_limit = null ]) : int
Parameters
$memory_limit : null|string = null
Return values
int

processData()

private processData(string $data) : void
Parameters
$data : string
On this page

Search results