# Class: SockJSSocket

## vertx-web-js/sock_js_socket~ SockJSSocket

#### new SockJSSocket()

  You interact with SockJS clients through instances of SockJS socket.

  Source:
    - sock_js_socket.js, line 37

### Methods

#### close()

  Close it
  Source:
    - sock_js_socket.js, line 198

#### drainHandler(handler) → {SockJSSocket}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `handler` | function |

  Source:
    - sock_js_socket.js, line 165

  ##### Returns:

  Type
    SockJSSocket

#### endHandler(endHandler) → {SockJSSocket}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `endHandler` | function |

  Source:
    - sock_js_socket.js, line 123

  ##### Returns:

  Type
    SockJSSocket

#### exceptionHandler(handler) → {SockJSSocket}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `handler` | function |

  Source:
    - sock_js_socket.js, line 63

  ##### Returns:

  Type
    SockJSSocket

#### handler(handler) → {SockJSSocket}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `handler` | function |

  Source:
    - sock_js_socket.js, line 79

  ##### Returns:

  Type
    SockJSSocket

#### 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
  Source:
    - sock_js_socket.js, line 241

  ##### Returns:

  Type
    MultiMap

#### localAddress() → {SocketAddress}

  Return the local address for this socket
  Source:
    - sock_js_socket.js, line 226

  ##### Returns:

  Type
    SocketAddress

#### pause() → {SockJSSocket}

  Source:
    - sock_js_socket.js, line 95

  ##### Returns:

  Type
    SockJSSocket

#### remoteAddress() → {SocketAddress}

  Return the remote address for this socket
  Source:
    - sock_js_socket.js, line 212

  ##### Returns:

  Type
    SocketAddress

#### resume() → {SockJSSocket}

  Source:
    - sock_js_socket.js, line 109

  ##### Returns:

  Type
    SockJSSocket

#### setWriteQueueMaxSize(maxSize) → {SockJSSocket}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `maxSize` | number |

  Source:
    - sock_js_socket.js, line 151

  ##### Returns:

  Type
    SockJSSocket

#### uri() → {string}

  Return the URI corresponding to the last request for this socket or the websocket handshake
  Source:
    - sock_js_socket.js, line 255

  ##### Returns:

  Type
    string

#### webSession() → {Session}

  Source:
    - sock_js_socket.js, line 269

  ##### Returns:

  - the Vert.x-Web session corresponding to this socket
  - Type
      Session

#### webUser() → {User}

  Source:
    - sock_js_socket.js, line 283

  ##### Returns:

  - the Vert.x-Web user corresponding to this socket
  - Type
      User

#### write(data) → {SockJSSocket}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `data` | Buffer |

  Source:
    - sock_js_socket.js, line 137

  ##### Returns:

  Type
    SockJSSocket

#### 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`.

  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.

  Source:
    - sock_js_socket.js, line 185

  ##### Returns:

  Type
    string

#### writeQueueFull() → {boolean}

  Source:
    - sock_js_socket.js, line 50

  ##### Returns:

  Type
    boolean