PHP 클래스 Wrench\Payload\Payload

Represents a WebSocket protocol payload, which may be made up of multiple frames.
파일 보기 프로젝트 열기: varspool/Wrench 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$buffer String representation of the payload contents
$frames Wrench\Frame\Frame[] A payload may consist of one or more frames

공개 메소드들

메소드 설명
__toString ( ) : string
encode ( string $data, integer $type = Protocol::TYPE_TEXT, boolean $masked = false ) : Payload Encodes a payload
getPayload ( ) : string
getRemainingData ( ) : number | null Gets the number of remaining bytes before this payload will be complete
getType ( ) : integer Gets the type of the payload
isComplete ( ) : boolean Whether the payload is complete
isWaitingForData ( ) : boolean Whether this payload is waiting for more data
receiveData ( string $data ) : void Receive raw data into the payload
sendToSocket ( Socket $socket ) : boolean

보호된 메소드들

메소드 설명
getCurrentFrame ( ) : mixed Gets the current frame for the payload
getFrame ( ) : Wrench\Frame\Frame Get a frame object
getReceivingFrame ( ) : Wrench\Frame\Frame Gets the frame into which data should be receieved

메소드 상세

__toString() 공개 메소드

public __toString ( ) : string
리턴 string

encode() 공개 메소드

Encodes a payload
public encode ( string $data, integer $type = Protocol::TYPE_TEXT, boolean $masked = false ) : Payload
$data string
$type integer
$masked boolean
리턴 Payload

getCurrentFrame() 보호된 메소드

Gets the current frame for the payload
protected getCurrentFrame ( ) : mixed
리턴 mixed

getFrame() 추상적인 보호된 메소드

Get a frame object
abstract protected getFrame ( ) : Wrench\Frame\Frame
리턴 Wrench\Frame\Frame

getPayload() 공개 메소드

public getPayload ( ) : string
리턴 string

getReceivingFrame() 보호된 메소드

Gets the frame into which data should be receieved
protected getReceivingFrame ( ) : Wrench\Frame\Frame
리턴 Wrench\Frame\Frame

getRemainingData() 공개 메소드

May return 0 (no more bytes required) or null (unknown number of bytes required).
public getRemainingData ( ) : number | null
리턴 number | null

getType() 공개 메소드

The type of a payload is taken from its first frame
public getType ( ) : integer
리턴 integer

isComplete() 공개 메소드

Whether the payload is complete
public isComplete ( ) : boolean
리턴 boolean

isWaitingForData() 공개 메소드

Whether this payload is waiting for more data
public isWaitingForData ( ) : boolean
리턴 boolean

receiveData() 공개 메소드

Receive raw data into the payload
public receiveData ( string $data ) : void
$data string
리턴 void

sendToSocket() 공개 메소드

public sendToSocket ( Socket $socket ) : boolean
$socket Wrench\Socket\Socket
리턴 boolean

프로퍼티 상세

$buffer 보호되어 있는 프로퍼티

String representation of the payload contents
protected $buffer

$frames 보호되어 있는 프로퍼티

A payload may consist of one or more frames
protected Frame[],Wrench\Frame $frames
리턴 Wrench\Frame\Frame[]