Packages

class SockJSSocket extends ReadStream[Buffer] with WriteStream[Buffer]

You interact with SockJS clients through instances of SockJS socket.

The API is very similar to io.vertx.scala.core.http.WebSocket. It implements both and so it can be used with io.vertx.scala.core.streams.Pump to pump data with flow control.

Linear Supertypes
WriteStream[Buffer], ReadStream[Buffer], StreamBase, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SockJSSocket
  2. WriteStream
  3. ReadStream
  4. StreamBase
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SockJSSocket(_asJava: AnyRef)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def asJava: AnyRef
    Definition Classes
    SockJSSocketWriteStreamReadStreamStreamBase
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. def close(): Unit

    Close it

  8. def close(statusCode: Int, reason: String): Unit

    Close it giving a status code and reason.

    Close it giving a status code and reason. Only Applicable to RawWebSocket will downgrade to plain close for other transports.

  9. def drainHandler(handler: Handler[Unit]): SockJSSocket

    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 is ready to accept buffers again. See io.vertx.scala.core.streams.Pump for an example of this being used.

    The stream implementation defines when the drain handler, for example it could be when the queue size has been reduced to maxSize / 2. * @param handler the handler

    returns

    a reference to this, so the API can be used fluently

    Definition Classes
    SockJSSocketWriteStream
  10. def end(): Unit

    Call io.vertx.scala.ext.web.handler.sockjs.SockJSSocket#end.

  11. def end(arg0: Handler[AsyncResult[Unit]]): Unit

    Same as io.vertx.scala.core.streams.WriteStream#end but with an handler called when the operation completes

    Same as io.vertx.scala.core.streams.WriteStream#end but with an handler called when the operation completes

    Definition Classes
    SockJSSocketWriteStream
  12. def end(data: Buffer, handler: Handler[AsyncResult[Unit]]): Unit

    Same as but with an handler called when the operation completes

    Same as but with an handler called when the operation completes

    Definition Classes
    SockJSSocketWriteStream
  13. def end(data: Buffer): Unit

    Same as io.vertx.scala.core.streams.WriteStream#end but writes some data to the stream before ending.

    Same as io.vertx.scala.core.streams.WriteStream#end but writes some data to the stream before ending. * @param data the data to write

    Definition Classes
    SockJSSocketWriteStream
  14. def endFuture(data: Buffer): Future[Unit]

    Like end but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like end but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
    SockJSSocketWriteStream
  15. def endFuture(): Future[Unit]

    Like end but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like end but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
    SockJSSocketWriteStream
  16. def endHandler(endHandler: Handler[Unit]): SockJSSocket

    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. * @return a reference to this, so the API can be used fluently

    Definition Classes
    SockJSSocketReadStream
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  19. def exceptionHandler(handler: Handler[Throwable]): SockJSSocket

    Set an exception handler on the write stream.

    Set an exception handler on the write stream. * @param handler the exception handler

    returns

    a reference to this, so the API can be used fluently

    Definition Classes
    SockJSSocketWriteStreamReadStreamStreamBase
  20. def fetch(arg0: Long): ReadStream[Buffer]

    Fetch the specified amount of elements.

    Fetch the specified amount of elements. If the ReadStream has been paused, reading will recommence with the specified amount of items, otherwise the specified amount will be added to the current stream demand. * @return a reference to this, so the API can be used fluently

    Definition Classes
    SockJSSocketReadStream
  21. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. def handler(handler: Handler[Buffer]): SockJSSocket

    Set a data handler.

    Set a data handler. As data is read, the handler will be called with the data. * @return a reference to this, so the API can be used fluently

    Definition Classes
    SockJSSocketReadStream
  24. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. def headers(): MultiMap

    Return the headers corresponding to the last request for this socket or the websocket handshake Any cookie headers will be removed for security reasons

  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. def localAddress(): SocketAddress

    Return the local address for this socket

  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. def pause(): SockJSSocket

    Pause the ReadStream, it sets the buffer in fetch mode and clears the actual demand.

    Pause the ReadStream, it sets the buffer in fetch mode and clears the actual demand.

    While it's paused, no data will be sent to the data handler. * @return a reference to this, so the API can be used fluently

    Definition Classes
    SockJSSocketReadStream
  32. def pipe(): Pipe[Buffer]

    Pause this stream and return a io.vertx.scala.core.streams.Pipe to transfer the elements of this stream to a destination io.vertx.scala.core.streams.WriteStream.

    Pause this stream and return a io.vertx.scala.core.streams.Pipe to transfer the elements of this stream to a destination io.vertx.scala.core.streams.WriteStream.

    The stream will be resumed when the pipe will be wired to a WriteStream. * @return a pipe

    Definition Classes
    SockJSSocketReadStream
  33. def pipeTo(dst: WriteStream[Buffer], handler: Handler[AsyncResult[Unit]]): Unit

    Pipe this ReadStream to the WriteStream.

    Pipe this ReadStream to the WriteStream.

    Elements emitted by this stream will be written to the write stream until this stream ends or fails.

    Once this stream has ended or failed, the write stream will be ended and the handler will be called with the result. * @param dst the destination write stream

    Definition Classes
    SockJSSocketReadStream
  34. def pipeTo(dst: WriteStream[Buffer]): Unit

    Like io.vertx.scala.core.streams.ReadStream#pipeTo but with no completion handler.

    Like io.vertx.scala.core.streams.ReadStream#pipeTo but with no completion handler.

    Definition Classes
    SockJSSocketReadStream
  35. def pipeToFuture(dst: WriteStream[Buffer]): Future[Unit]

    Like pipeTo but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like pipeTo but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
    SockJSSocketReadStream
  36. def remoteAddress(): SocketAddress

    Return the remote address for this socket

  37. def resume(): SockJSSocket

    Resume reading, and sets the buffer in flowing mode.

    Resume reading, and sets the buffer in flowing mode.

    If the ReadStream has been paused, reading will recommence on it. * @return a reference to this, so the API can be used fluently

    Definition Classes
    SockJSSocketReadStream
  38. def setWriteQueueMaxSize(maxSize: Int): SockJSSocket

    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 items in the write queue. This is used as an indicator by classes such as Pump to provide flow control.

    The value is defined by the implementation of the stream, e.g in bytes for a io.vertx.scala.core.net.NetSocket, the number of io.vertx.scala.core.eventbus.Message for a io.vertx.scala.core.eventbus.MessageProducer, etc... * @param maxSize the max size of the write stream

    returns

    a reference to this, so the API can be used fluently

    Definition Classes
    SockJSSocketWriteStream
  39. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  40. def toString(): String
    Definition Classes
    AnyRef → Any
  41. def uri(): String

    Return the URI corresponding to the last request for this socket or the websocket handshake

  42. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  45. def webSession(): Option[Session]

    returns

    the Vert.x-Web session corresponding to this socket

  46. def webUser(): Option[User]

    returns

    the Vert.x-Web user corresponding to this socket

  47. def write(data: String, handler: Handler[AsyncResult[Unit]]): SockJSSocket
  48. def write(data: Buffer, handler: Handler[AsyncResult[Unit]]): SockJSSocket

    Same as but with an handler called when the operation completes

    Same as but with an handler called when the operation completes

    Definition Classes
    SockJSSocketWriteStream
  49. def write(data: String): SockJSSocket

    Write a String to the socket, encoded in UTF-8.

    Write a String to the socket, encoded in UTF-8. * @param data the string to write

    returns

    a reference to this, so the API can be used fluently

  50. def write(data: Buffer): SockJSSocket

    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 io.vertx.scala.core.streams.WriteStream#writeQueueFull method before writing. This is done automatically if using a io.vertx.scala.core.streams.Pump. * @param data the data to write

    returns

    a reference to this, so the API can be used fluently

    Definition Classes
    SockJSSocketWriteStream
  51. def writeFuture(data: Buffer): Future[Unit]

    Like write but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like write but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
    SockJSSocketWriteStream
  52. def writeFuture(data: String): Future[Unit]
  53. def writeHandlerID(): String

    When a SockJSSocket is created it automatically registers an event handler with the event bus, the ID of that handler is given by writeHandlerID.

    When a SockJSSocket is created it automatically registers an event handler with the event bus, the ID of that handler is given by writeHandlerID.

    Given this ID, a different event loop can send a buffer 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 socket. This allows you to write data to other sockets which are owned by different event loops.

  54. def writeQueueFull(): Boolean

    This will return true if there are more bytes in the write queue than the value set using io.vertx.scala.core.streams.WriteStream#setWriteQueueMaxSize * @return true if write queue is full

    This will return true if there are more bytes in the write queue than the value set using io.vertx.scala.core.streams.WriteStream#setWriteQueueMaxSize * @return true if write queue is full

    Definition Classes
    SockJSSocketWriteStream

Inherited from WriteStream[Buffer]

Inherited from ReadStream[Buffer]

Inherited from StreamBase

Inherited from AnyRef

Inherited from Any

Ungrouped