public interface WebSocketStream extends ReadStream<WebSocket>
A stream for HttpClient
websocket connection.
When the connection attempt is successful, the stream handler is called back with the WebSocket
argument, immediatly followed by a call to the end handler. When the connection attempt fails, the exception handler is invoked.
The connection occurs when the handler(io.vertx.core.Handler<io.vertx.core.http.WebSocket>)
method is called with a non null handler, the other handlers should be
set before setting the handler.
Modifier and Type | Method and Description |
---|---|
WebSocketStream |
endHandler(Handler<Void> endHandler)
Set an end handler.
|
WebSocketStream |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler.
|
WebSocketStream |
handler(Handler<WebSocket> handler)
Set a data handler.
|
WebSocketStream |
pause()
Pause the
ReadSupport . |
WebSocketStream |
resume()
Resume reading.
|
WebSocketStream exceptionHandler(Handler<Throwable> handler)
StreamBase
Set an exception handler.
exceptionHandler
in interface ReadStream<WebSocket>
exceptionHandler
in interface StreamBase
WebSocketStream handler(Handler<WebSocket> handler)
ReadStream
Set a data handler. As data is read, the handler will be called with the data.
handler
in interface ReadStream<WebSocket>
WebSocketStream pause()
ReadStream
Pause the ReadSupport
. While it’s paused, no data will be sent to the dataHandler
pause
in interface ReadStream<WebSocket>
WebSocketStream resume()
ReadStream
Resume reading. If the ReadSupport
has been paused, reading will recommence on it.
resume
in interface ReadStream<WebSocket>
WebSocketStream endHandler(Handler<Void> endHandler)
ReadStream
Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
endHandler
in interface ReadStream<WebSocket>
Copyright © 2014. All Rights Reserved.