@groovy.transform.CompileStatic class WebSocket extends java.lang.Object
Represents a client-side WebSocket.
Constructor and description |
---|
WebSocket
(java.lang.Object delegate) |
Type | Name and description |
---|---|
java.lang.String |
binaryHandlerID() When a Websocket is created it automatically registers an event handler with the event bus - the ID of that
handler is given by this method. |
void |
close() Close the WebSocket. |
WebSocket |
closeHandler(io.vertx.core.Handler<java.lang.Void> handler) |
WebSocket |
drainHandler(io.vertx.core.Handler<java.lang.Void> handler) |
void |
end(Buffer t) Same as WebSocketBase.end but writes some data to the stream before ending. |
void |
end() Calls WebSocketBase.close |
WebSocket |
endHandler(io.vertx.core.Handler<java.lang.Void> endHandler) |
WebSocket |
exceptionHandler(io.vertx.core.Handler<java.lang.Throwable> handler) |
WebSocket |
frameHandler(io.vertx.core.Handler<WebSocketFrame> handler) |
java.lang.Object |
getDelegate() |
WebSocket |
handler(io.vertx.core.Handler<Buffer> handler) |
SocketAddress |
localAddress() @return
|
WebSocket |
pause() |
SocketAddress |
remoteAddress() @return
|
WebSocket |
resume() |
WebSocket |
setWriteQueueMaxSize(int maxSize) |
java.lang.String |
textHandlerID() When a Websocket is created it automatically registers an event handler with the eventbus, the ID of that
handler is given by textHandlerID . |
WebSocket |
write(Buffer data) |
WebSocket |
writeBinaryMessage(Buffer data) |
WebSocket |
writeFinalBinaryFrame(Buffer data) |
WebSocket |
writeFinalTextFrame(java.lang.String text) |
WebSocket |
writeFrame(WebSocketFrame frame) |
boolean |
writeQueueFull() This will return true if there are more bytes in the write queue than the value set using WebSocket.setWriteQueueMaxSize |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
When a Websocket
is created it automatically registers an event handler with the event bus - the ID of that
handler is given by this method.
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.
Close the WebSocket.
Same as WebSocketBase.end but writes some data to the stream before ending.
Calls WebSocketBase.close
When a Websocket
is created it automatically registers an event handler with the eventbus, the ID of that
handler is given by textHandlerID
.
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.
This will return true
if there are more bytes in the write queue than the value set using WebSocket.setWriteQueueMaxSize