Base WebSocket implementation.
It implements both and so it can be used with
see |
to pump data with flow control. |
---|---|
package |
Default |
__construct()
binaryHandlerID() : string
Given this ID, a different event loop can send a binary frame to that event handler using the event bus and that buffer will be received by this instance in its own event loop and written to the underlying connection. This allows you to write data to other WebSockets which are owned by different event loops.
string
the binary handler id
binaryMessageHandler( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
close( $arg0 = null, $arg1 = null) : void
No more messages can be sent.
close()
param $statusCode [integer] close($statusCode)
param $statusCode [integer] param $reason [string] close($statusCode, $reason)
integer
string
closeHandler( $arg0) : $this
After this callback, no more messages are expected.
callable
$this
a reference to this, so the API can be used fluently
drainHandler( $arg0) : $this
callable
$this
end( $arg0 = null) : void
end()
Same as @see \io\vertx\jphp\core\http\WebSocketBase::end but writes some data to the stream before ending.
param $t [Buffer] end($t)
Buffer
endHandler( $arg0) : $this
callable
$this
exceptionHandler( $arg0) : $this
callable
$this
fetch( $arg0) : $this
integer
$this
frameHandler( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
handler( $arg0) : $this
callable
$this
isSsl() : boolean
boolean
true if this {@link io.vertx.core.http.HttpConnection} is encrypted via SSL/TLS.
localAddress() : \io\vertx\jphp\core\net\SocketAddress
pause() : $this
$this
pongHandler( $arg0) : $this
Pong frames may be at most 125 bytes (octets).
There is no ping handler since pings should immediately be responded to with a pong with identical content
Pong frames may be received unsolicited.
callable
$this
a reference to this, so the API can be used fluently
remoteAddress() : \io\vertx\jphp\core\net\SocketAddress
resume() : $this
$this
setWriteQueueMaxSize( $arg0) : $this
integer
$this
subProtocol() : string
On the server, the value will be null
when the handler receives the websocket callback as the
handshake will not be completed yet.
string
textHandlerID() : string
Given this ID, a different event loop can send a text frame to that event handler using the event bus and that buffer will be received by this instance in its own event loop and written to the underlying connection. This allows you to write data to other WebSockets which are owned by different event loops.
string
textMessageHandler( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
write( $arg0) : $this
Buffer
$this
writeBinaryMessage( $arg0) : $this
Buffer
$this
a reference to this, so the API can be used fluently
writeFinalBinaryFrame( $arg0) : $this
Buffer
$this
a reference to this, so the API can be used fluently
writeFinalTextFrame( $arg0) : $this
string
$this
a reference to this, so the API can be used fluently
writeFrame( $arg0) : $this
WebSocketFrame
$this
a reference to this, so the API can be used fluently
writePing( $arg0) : $this
This method should not be used to write application data and should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 Section 5.5.2.
There is no pingHandler because RFC 6455 section 5.5.2 clearly states that the only response to a ping is a pong with identical contents.
Buffer
$this
a reference to this, so the API can be used fluently
writePong( $arg0) : $this
This method should not be used to write application data and should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 Section 5.5.2.
There is no need to manually write a Pong, as the server and client both handle responding to a ping with a pong automatically and this is exposed to users.RFC 6455 Section 5.5.3 states that pongs may be sent unsolicited in order to implement a one way heartbeat.
Buffer
$this
a reference to this, so the API can be used fluently
writeQueueFull() : boolean
boolean
true if write queue is full
writeTextMessage( $arg0) : $this
string
$this
a reference to this, so the API can be used fluently