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
$checkForMask
private
bool
$checkForMask
$closeFrameChecker
private
CloseFrameChecker
$closeFrameChecker
$compressedMessage
private
bool
$compressedMessage
$deflateEnabled
private
bool
$deflateEnabled
= false
$deflator
private
mixed
$deflator
$exceptionFactory
private
callable
$exceptionFactory
$frameBuffer
private
Frame
$frameBuffer
$inflator
private
mixed
$inflator
$leftovers
private
string
$leftovers
$maxFramePayloadSize
private
int
$maxFramePayloadSize
$maxMessagePayloadSize
private
int
$maxMessagePayloadSize
$messageBuffer
private
Message
$messageBuffer
$onControl
private
callable
$onControl
$onMessage
private
callable
$onMessage
$permessageDeflateOptions
private
PermessageDeflateOptions
$permessageDeflateOptions
$sender
private
callable
$sender
$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
frameCheck()
Check a frame to be added to the current message buffer
public
frameCheck(FrameInterface $frame) : FrameInterface
Parameters
- $frame : FrameInterface
Return values
FrameInterfacenewCloseFrame()
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
FrameInterfacenewMessage()
public
newMessage() : MessageInterface
Return values
MessageInterfaceonData()
public
onData(mixed $data) : mixed
Parameters
- $data : mixed
sendFrame()
public
sendFrame(Frame $frame) : mixed
Parameters
- $frame : Frame
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
deflateFrame()
private
deflateFrame(Frame $frame) : mixed
Parameters
- $frame : Frame
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
intinflateFrame()
private
inflateFrame(Frame $frame) : mixed
Parameters
- $frame : Frame
processData()
private
processData(string $data) : null
Parameters
- $data : string