io.vertx.core.http

## Interface WebSocketStream

- All Superinterfaces:
    ReadStream<WebSocket>, StreamBase

      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, immediately 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.

  Author:
    Julien Viet

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `WebSocketStream` | `endHandler(Handler<Void> endHandler)` Set an end handler.
    `WebSocketStream` | `exceptionHandler(Handler<Throwable> handler)` Set an exception handler on the read stream.
    `WebSocketStream` | `handler(Handler<WebSocket> handler)` Set a data handler.
    `WebSocketStream` | `pause()` Pause the `ReadSupport`.
    `WebSocketStream` | `resume()` Resume reading.

- - ### Method Detail

    - #### exceptionHandler

          WebSocketStream exceptionHandler(Handler<Throwable> handler)

      Description copied from interface: `ReadStream`
      Set an exception handler on the read stream.
      Specified by:
        `exceptionHandler` in interface `ReadStream<WebSocket>`
      Specified by:
        `exceptionHandler` in interface `StreamBase`
      Parameters:
        `handler` - the exception handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### handler

          WebSocketStream handler(Handler<WebSocket> handler)

      Description copied from interface: `ReadStream`
      Set a data handler. As data is read, the handler will be called with the data.
      Specified by:
        `handler` in interface `ReadStream<WebSocket>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### pause

          WebSocketStream pause()

      Description copied from interface: `ReadStream`
      Pause the `ReadSupport`. While it's paused, no data will be sent to the `dataHandler`
      Specified by:
        `pause` in interface `ReadStream<WebSocket>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### resume

          WebSocketStream resume()

      Description copied from interface: `ReadStream`
      Resume reading. If the `ReadSupport` has been paused, reading will recommence on it.
      Specified by:
        `resume` in interface `ReadStream<WebSocket>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### endHandler

          WebSocketStream endHandler(Handler<Void> endHandler)

      Description copied from interface: `ReadStream`
      Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
      Specified by:
        `endHandler` in interface `ReadStream<WebSocket>`
      Returns:
        a reference to this, so the API can be used fluently

Copyright © 2016. All rights reserved.