Package: io.vertx.groovy.ext.web.handler.sockjs

## [Groovy] Class SockJSSocket

- io.vertx.groovy.ext.web.handler.sockjs.SockJSSocket

- All Implemented Interfaces and Traits:
    ReadStream, WriteStream

      @groovy.transform.CompileStatic
      class SockJSSocket
      extends java.lang.Object

  You interact with SockJS clients through instances of SockJS socket.

  The API is very similar to WebSocket. It implements both and so it can be used with Pump to pump data with flow control.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `SockJSSocket (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `close()` Close it
    `SockJSSocket` | `drainHandler(io.vertx.core.Handler<java.lang.Void> handler)`
    `void` | `end(Buffer t)`
    `void` | `end()` Call SockJSSocket.end.
    `SockJSSocket` | `endHandler(io.vertx.core.Handler<java.lang.Void> endHandler)`
    `SockJSSocket` | `exceptionHandler(io.vertx.core.Handler<java.lang.Throwable> handler)`
    `java.lang.Object` | `getDelegate()`
    `SockJSSocket` | `handler(io.vertx.core.Handler<Buffer> handler)`
    `MultiMap` | `headers()` Return the headers corresponding to the last request for this socket or the websocket handshake Any cookie headers will be removed for security reasons @return
    `SocketAddress` | `localAddress()` Return the local address for this socket @return
    `SockJSSocket` | `pause()`
    `SocketAddress` | `remoteAddress()` Return the remote address for this socket @return
    `SockJSSocket` | `resume()`
    `SockJSSocket` | `setWriteQueueMaxSize(int maxSize)`
    `java.lang.String` | `uri()` Return the URI corresponding to the last request for this socket or the websocket handshake @return
    `Session` | `webSession()` @return Returns: the Vert.x-Web session corresponding to this socket
    `User` | `webUser()` @return Returns: the Vert.x-Web user corresponding to this socket
    `SockJSSocket` | `write(Buffer data)`
    `java.lang.String` | `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`.
    `boolean` | `writeQueueFull()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `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

    - #### SockJSSocket(java.lang.Object delegate)

  - ### Method Detail

    - #### void close()

      Close it

    - #### SockJSSocket drainHandler(io.vertx.core.Handler<java.lang.Void> handler)

    - #### void end(Buffer t)

    - #### void end()

      Call SockJSSocket.end.

    - #### SockJSSocket endHandler(io.vertx.core.Handler<java.lang.Void> endHandler)

    - #### SockJSSocket exceptionHandler(io.vertx.core.Handler<java.lang.Throwable> handler)

    - #### java.lang.Object getDelegate()

    - #### SockJSSocket handler(io.vertx.core.Handler<Buffer> handler)

    - #### MultiMap headers()

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

      Returns:

    - #### SocketAddress localAddress()

      Return the local address for this socket

      Returns:

    - #### SockJSSocket pause()

    - #### SocketAddress remoteAddress()

      Return the remote address for this socket

      Returns:

    - #### SockJSSocket resume()

    - #### SockJSSocket setWriteQueueMaxSize(int maxSize)

    - #### java.lang.String uri()

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

      Returns:

    - #### Session webSession()

      Returns:
        the Vert.x-Web session corresponding to this socket

    - #### User webUser()

      Returns:
        the Vert.x-Web user corresponding to this socket

    - #### SockJSSocket write(Buffer data)

    - #### java.lang.String 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.

      Returns:

    - #### boolean writeQueueFull()