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

      @CompileStatic
      class SockJSSocket

  You interact with SockJS clients through instances of SockJS socket.

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

- - ### Constructor Summary

    Constructors
    Constructor and description
    `SockJSSocket (Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `close()` Close it
    `SockJSSocket` | `drainHandler(Handler<Void> handler)`
    `SockJSSocket` | `endHandler(Handler<Void> endHandler)`
    `SockJSSocket` | `exceptionHandler(Handler<Throwable> handler)`
    `Object` | `getDelegate()`
    `SockJSSocket` | `handler(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)`
    `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)`
    `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 Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### SockJSSocket(Object delegate)

  - ### Method Detail

    - #### void close()

      Close it

    - #### SockJSSocket drainHandler(Handler<Void> handler)

    - #### SockJSSocket endHandler(Handler<Void> endHandler)

    - #### SockJSSocket exceptionHandler(Handler<Throwable> handler)

    - #### Object getDelegate()

    - #### SockJSSocket handler(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)

    - #### 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)

    - #### 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()