You interact with SockJS clients through instances of SockJS socket.
The API is very similar to @see \io\vertx\jphp\core\http\WebSocket. It implements both and so it can be used with
see |
to pump data with flow control. |
---|---|
package |
Default |
__construct()
close( $arg0 = null, $arg1 = null) : void
close()
Close it giving a status code and reason. Only Applicable to RawWebSocket will downgrade to plain close for other transports.
param $statusCode [integer] param $reason [string] close($statusCode, $reason)
integer
string
drainHandler( $arg0) : $this
callable
$this
end( $arg0 = null) : void
end()
Same as @see \io\vertx\jphp\ext\web\handler\sockjs\SockJSSocket::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
a reference to this, so the API can be used fluently
handler( $arg0) : $this
callable
$this
headers() : \io\vertx\jphp\core\MultiMap
localAddress() : \io\vertx\jphp\core\net\SocketAddress
pause() : $this
$this
remoteAddress() : \io\vertx\jphp\core\net\SocketAddress
resume() : $this
$this
setWriteQueueMaxSize( $arg0) : $this
integer
$this
uri() : string
string
webSession() : \io\vertx\jphp\ext\web\Session
webUser() : \io\vertx\jphp\ext\auth\User
write( $arg0) : $this
Write a \java.lang.String to the socket, encoded in UTF-8.
param $data [string] the string to write write($data)
Buffer | string
$this
writeHandlerID() : string
Given this ID, a different event loop can send a buffer 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 socket. This allows you to write data to other sockets which are owned by different event loops.
string
writeQueueFull() : boolean
boolean
true if write queue is full