org.vertx.scala.core.http

WebSocketBase

trait WebSocketBase extends Self with ReadStream with WriteStream

Represents an HTML 5 Websocket

Instances of this class are created and provided to the handler of an org.vertx.scala.core.http.HttpClient when a successful websocket connect attempt occurs.

On the server side, the subclass org.vertx.scala.core.http.ServerWebSocket is used instead.

It implements both org.vertx.scala.core.streams.ReadStream and org.vertx.scala.core.streams.WriteStream so it can be used with org.vertx.scala.core.streams.Pump to pump data with flow control.

Instances of this class are not thread-safe

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. WebSocketBase
  2. WriteStream
  3. ReadStream
  4. ReadSupport
  5. ExceptionSupport
  6. AsJava
  7. Self
  8. AnyRef
  9. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract type J <: java.core.http.WebSocketBase[J]

    The internal type of the Java wrapped class.

    The internal type of the Java wrapped class.

    Definition Classes
    WebSocketBaseWriteStreamReadStreamReadSupportExceptionSupport → AsJava

Abstract Value Members

  1. abstract val asJava: J

    The internal instance of the Java wrapped class.

    The internal instance of the Java wrapped class.

    Definition Classes
    AsJava

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def binaryHandlerID(): String

    When a Websocket is created it automatically registers an event handler with the eventbus, the ID of that handler is given by binaryHandlerID.

    When a Websocket is created it automatically registers an event handler with the eventbus, the ID of that handler is given by binaryHandlerID.

    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.

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def close(): Unit

    Close the websocket

  10. def closeHandler(handler: ⇒ Unit): WebSocketBase.this.type

    Set a closed handler on the connection

  11. def dataHandler(handler: (Buffer) ⇒ Unit): WebSocketBase.this.type

    Set a data handler.

    Set a data handler. As data is read, the handler will be called with the data.

    Definition Classes
    ReadStreamReadSupport
  12. def drainHandler(handler: ⇒ Unit): WebSocketBase.this.type

    Set a drain handler on the stream.

    Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write queue has been reduced to maxSize / 2. See org.vertx.scala.core.streams.Pump for an example of this being used.

    Definition Classes
    WriteStream
  13. def endHandler(handler: ⇒ Unit): WebSocketBase.this.type

    Set an end handler.

    Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.

    Definition Classes
    ReadStream
  14. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  16. def exceptionHandler(handler: (Throwable) ⇒ Unit): WebSocketBase.this.type

    Set an exception handler.

    Set an exception handler.

    Definition Classes
    ExceptionSupport
  17. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. def localAddress(): InetSocketAddress

    Return the local address for this socket

  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. def pause(): WebSocketBase.this.type

    Pause the ReadSupport.

    Pause the ReadSupport. While it's paused, no data will be sent to the dataHandler

    Definition Classes
    ReadSupport
  26. def remoteAddress(): InetSocketAddress

    Return the remote address for this socket

  27. def resume(): WebSocketBase.this.type

    Resume reading.

    Resume reading. If the ReadSupport has been paused, reading will recommence on it.

    Definition Classes
    ReadSupport
  28. def setWriteQueueMaxSize(maxSize: Int): WebSocketBase.this.type

    Set the maximum size of the write queue to maxSize.

    Set the maximum size of the write queue to maxSize. You will still be able to write to the stream even if there is more than maxSize bytes in the write queue. This is used as an indicator by classes such as Pump to provide flow control.

    Definition Classes
    WriteStream
  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  30. def textHandlerID(): String

    When a Websocket} is created it automatically registers an event handler with the eventbus, the ID of that handler is given by textHandlerID}.

    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.

  31. def toString(): String

    Definition Classes
    AnyRef → Any
  32. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. def wrap[X](doStuff: ⇒ X): WebSocketBase.this.type

    Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types

    Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types

    Attributes
    protected[this]
    Definition Classes
    Self
  36. def write(data: Buffer): WebSocketBase.this.type

    Write some data to the stream.

    Write some data to the stream. The data is put on an internal write queue, and the write actually happens asynchronously. To avoid running out of memory by putting too much on the write queue, check the org.vertx.scala.core.streams.WriteStream.writeQueueFull() method before writing. This is done automatically if using a org.vertx.scala.core.streams.Pump.

    Definition Classes
    WriteStream
  37. def writeBinaryFrame(data: Buffer): WebSocketBase.this.type

    Write data to the websocket as a binary frame

  38. def writeQueueFull(): Boolean

    This will return true if there are more bytes in the write queue than the value set using org.vertx.scala.core.streams.WriteStream.setWriteQueueMaxSize()

    This will return true if there are more bytes in the write queue than the value set using org.vertx.scala.core.streams.WriteStream.setWriteQueueMaxSize()

    Definition Classes
    WriteStream
  39. def writeTextFrame(str: String): WebSocketBase.this.type

    Write str to the websocket as a text frame

Inherited from WriteStream

Inherited from ReadStream

Inherited from ReadSupport[Buffer]

Inherited from ExceptionSupport

Inherited from AsJava

Inherited from Self

Inherited from AnyRef

Inherited from Any

Ungrouped