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
$checkForMask
private
bool
$checkForMask
$closeFrameChecker
private
CloseFrameChecker
$closeFrameChecker
$compressedMessage
private
bool
$compressedMessage
= false
$deflateEnabled
private
bool
$deflateEnabled
$deflator
private
resource|bool|null
$deflator
= null
$exceptionFactory
private
callable
$exceptionFactory
$frameBuffer
private
FrameInterface|null
$frameBuffer
= null
$inflator
private
resource|bool|null
$inflator
= null
$leftovers
private
string
$leftovers
= ''
$maxFramePayloadSize
private
int
$maxFramePayloadSize
$maxMessagePayloadSize
private
int
$maxMessagePayloadSize
$messageBuffer
private
MessageInterface|null
$messageBuffer
= null
$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|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
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(int $code[, string $reason = '' ]) : FrameInterface
Parameters
- $code : int
- $reason : string = ''
Return values
FrameInterfacenewFrame()
public
newFrame([string|null $payload = null ][, bool $final = true ][, int $opcode = Frame::OP_TEXT ]) : FrameInterface
Parameters
- $payload : string|null = null
- $final : bool = true
- $opcode : int = Frame::OP_TEXT
Return values
FrameInterfacenewMessage()
public
newMessage() : MessageInterface
Return values
MessageInterfaceonData()
public
onData(string $data) : void
Parameters
- $data : string
sendFrame()
public
sendFrame(FrameInterface $frame) : void
Parameters
- $frame : FrameInterface
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
booldeflateFrame()
private
deflateFrame(FrameInterface $frame) : FrameInterface
Parameters
- $frame : FrameInterface
Return values
FrameInterfacegetDeflateNoContextTakeover()
private
getDeflateNoContextTakeover() : bool|null
Return values
bool|nullgetDeflateWindowBits()
private
getDeflateWindowBits() : int
Return values
intgetInflateNoContextTakeover()
private
getInflateNoContextTakeover() : bool|null
Return values
bool|nullgetInflateWindowBits()
private
getInflateWindowBits() : int
Return values
intgetMemoryLimit()
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(FrameInterface $frame) : Frame
Parameters
- $frame : FrameInterface
Return values
FrameprocessData()
private
processData(string $data) : void
Parameters
- $data : string