WebSocketFrame

A WebSocket frame that represents either text or binary data.

A WebSocket message is composed of one or more WebSocket frames.

If there is a just a single frame in the message then a single text or binary frame should be created with final = true.

If there are more than one frames in the message, then the first frame should be a text or binary frame with final = false, followed by one or more continuation frames. The last continuation frame should have final = true.

package

Default

Methods

__construct

__construct() 

binaryData

binaryData() : \io\vertx\jphp\core\buffer\Buffer

Response

\io\vertx\jphp\core\buffer\Buffer

the data of the frame

Create a binary WebSocket frame.

binaryFrame( $arg0,  $arg1) : \io\vertx\jphp\core\http\WebSocketFrame
static

Arguments

$arg0

Buffer

$arg1

boolean

Response

\io\vertx\jphp\core\http\WebSocketFrame

the frame

closeReason

closeReason() : string

Response

string

string explaining close reason. Only use this for close frames

closeStatusCode

closeStatusCode() : integer

Response

integer

status code of close frame. Only use this for close frames

Create a continuation frame

continuationFrame( $arg0,  $arg1) : \io\vertx\jphp\core\http\WebSocketFrame
static

Arguments

$arg0

Buffer

$arg1

boolean

Response

\io\vertx\jphp\core\http\WebSocketFrame

the frame

isBinary

isBinary() : boolean

Response

boolean

true if it's a binary frame

isClose

isClose() : boolean

Response

boolean

true if it's close frame

isContinuation

isContinuation() : boolean

Response

boolean

true if it's a continuation frame

isFinal

isFinal() : boolean

Response

boolean

true if this is the final frame.

isText

isText() : boolean

Response

boolean

true if it's a text frame

Create a ping WebSocket frame. Will be a final frame. There is no option for non final ping frames.

pingFrame( $arg0) : \io\vertx\jphp\core\http\WebSocketFrame
static

Arguments

$arg0

Buffer

Response

\io\vertx\jphp\core\http\WebSocketFrame

the frame

Create a pong WebSocket frame. Will be a final frame. There is no option for non final pong frames.

pongFrame( $arg0) : \io\vertx\jphp\core\http\WebSocketFrame
static

Arguments

$arg0

Buffer

Response

\io\vertx\jphp\core\http\WebSocketFrame

the frame

textData

textData() : string

Response

string

the content of this frame as a UTF-8 string and returns the converted string. Only use this for text frames.

Create a text WebSocket frame.

textFrame( $arg0,  $arg1) : \io\vertx\jphp\core\http\WebSocketFrame
static

Arguments

$arg0

string

$arg1

boolean

Response

\io\vertx\jphp\core\http\WebSocketFrame

the frame