Documentation

MessageBuffer
in package

Table of Contents

Properties

$checkForMask  : bool
$closeFrameChecker  : CloseFrameChecker
$compressedMessage  : bool
$deflateEnabled  : bool
$deflator  : mixed
$exceptionFactory  : callable
$frameBuffer  : Frame
$inflator  : mixed
$leftovers  : string
$maxFramePayloadSize  : int
$maxMessagePayloadSize  : int
$messageBuffer  : Message
$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()  : mixed
newFrame()  : FrameInterface
newMessage()  : MessageInterface
onData()  : mixed
sendFrame()  : mixed
sendMessage()  : mixed
checkUtf8()  : mixed
deflateFrame()  : mixed
getDeflateNoContextTakeover()  : mixed
getDeflateWindowBits()  : mixed
getInflateNoContextTakeover()  : mixed
getInflateWindowBits()  : mixed
getMemoryLimit()  : int
This is a separate function for testing purposes $memory_limit is only used for testing
inflateFrame()  : mixed
processData()  : null

Properties

$streamingMessageOpCode

private int $streamingMessageOpCode = -1

Methods

__construct()

public __construct(CloseFrameChecker $frameChecker, callable $onMessage[, callable $onControl = null ][, mixed $expectMask = true ][, mixed $exceptionFactory = null ][, mixed $maxMessagePayloadSize = null ][, mixed $maxFramePayloadSize = null ][, callable $sender = null ][, PermessageDeflateOptions $permessageDeflateOptions = null ]) : mixed
Parameters
$frameChecker : CloseFrameChecker
$onMessage : callable
$onControl : callable = null
$expectMask : mixed = true
$exceptionFactory : mixed = null
$maxMessagePayloadSize : mixed = null
$maxFramePayloadSize : mixed = null
$sender : callable = null
$permessageDeflateOptions : PermessageDeflateOptions = 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

newCloseFrame()

public newCloseFrame(mixed $code[, mixed $reason = '' ]) : mixed
Parameters
$code : mixed
$reason : mixed = ''

newFrame()

public newFrame([string|null $payload = null ][, bool|null $final = null ][, int|null $opcode = null ]) : FrameInterface
Parameters
$payload : string|null = null
$final : bool|null = null
$opcode : int|null = null
Return values
FrameInterface

onData()

public onData(mixed $data) : mixed
Parameters
$data : mixed

sendMessage()

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

checkUtf8()

private checkUtf8(mixed $string) : mixed
Parameters
$string : mixed

getDeflateNoContextTakeover()

private getDeflateNoContextTakeover() : mixed

getDeflateWindowBits()

private getDeflateWindowBits() : mixed

getInflateNoContextTakeover()

private getInflateNoContextTakeover() : mixed

getInflateWindowBits()

private getInflateWindowBits() : mixed

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) : null
Parameters
$data : string
Return values
null

        
On this page

Search results