|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vertx.groovy.core.http.WebSocket
class WebSocket
Represents an HTML 5 Websocket
Instances of this class are created and provided to the handler of an HttpClient when a successful websocket connect attempt occurs.
On the server side, the subclass ServerWebSocket is used instead.
It implements both ReadStream and WriteStream so it can be used with Pump to pump data with flow control.
Instances of this class are not thread-safe
Constructor Summary | |
protected WebSocket(JWebSocket jWS)
|
Method Summary | |
---|---|
void
|
close()
Close the websocket |
void
|
closedHandler(java.lang.Object handler)
Set a closed handler on the connection |
void
|
dataHandler(groovy.lang.Closure handler)
{@inheritDoc} |
void
|
drainHandler(groovy.lang.Closure handler)
{@inheritDoc} |
void
|
endHandler(groovy.lang.Closure endHandler)
{@inheritDoc} |
void
|
exceptionHandler(groovy.lang.Closure handler)
{@inheritDoc} |
java.lang.String
|
getBinaryHandlerID()
When a Websocket is created it automatically registers an event handler with the eventbus, the ID of that handler is given by binaryHandlerID. |
java.lang.String
|
getTextHandlerID()
When a Websocket is created it automatically registers an event handler with the eventbus, the ID of that handler is given by textHandlerID. |
boolean
|
isWriteQueueFull()
{@inheritDoc} |
void
|
leftShift(Buffer buff)
Same as writeBinaryFrame(Buffer) |
void
|
leftShift(java.lang.String str)
Same as writeTextFrame(String) |
void
|
pause()
{@inheritDoc} |
void
|
resume()
{@inheritDoc} |
void
|
setWriteQueueMaxSize(int maxSize)
{@inheritDoc} |
void
|
writeBinaryFrame(Buffer data)
Write data to the websocket as binary frame |
void
|
writeBuffer(Buffer data)
{@inheritDoc} |
void
|
writeTextFrame(java.lang.String str)
Write str to the websocket as text frame |
Methods inherited from 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() |
Constructor Detail |
---|
protected WebSocket(JWebSocket jWS)
Method Detail |
---|
void close()
void closedHandler(java.lang.Object handler)
void dataHandler(groovy.lang.Closure handler)
void drainHandler(groovy.lang.Closure handler)
void endHandler(groovy.lang.Closure endHandler)
void exceptionHandler(groovy.lang.Closure handler)
java.lang.String getBinaryHandlerID()
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.
java.lang.String getTextHandlerID()
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.
boolean isWriteQueueFull()
void leftShift(Buffer buff)
void leftShift(java.lang.String str)
void pause()
void resume()
void setWriteQueueMaxSize(int maxSize)
void writeBinaryFrame(Buffer data)
void writeBuffer(Buffer data)
void writeTextFrame(java.lang.String str)
Groovy Documentation