# Class: SockJSSocket

## vertx-web-js/sock_js_socket~ SockJSSocket

#### new SockJSSocket()

You interact with SockJS clients through instances of SockJS socket.

Source:
  - vertx-web-js/sock_js_socket.js, line 37

### Methods

#### close()

Close it

Source:
  - vertx-web-js/sock_js_socket.js, line 216

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

##### Parameters:

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

Source:
  - vertx-web-js/sock_js_socket.js, line 183

##### Returns:

Type
  SockJSSocket

#### end(t)

##### Parameters:

Name | Type | Description
--- | --- | ---
`t` | Buffer |

Source:
  - vertx-web-js/sock_js_socket.js, line 49

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

##### Parameters:

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

Source:
  - vertx-web-js/sock_js_socket.js, line 137

##### Returns:

Type
  SockJSSocket

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

##### Parameters:

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

Source:
  - vertx-web-js/sock_js_socket.js, line 77

##### Returns:

Type
  SockJSSocket

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

##### Parameters:

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

Source:
  - vertx-web-js/sock_js_socket.js, line 93

##### 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:
  - vertx-web-js/sock_js_socket.js, line 259

##### Returns:

Type
  MultiMap

#### localAddress() → {SocketAddress}

Return the local address for this socket

Source:
  - vertx-web-js/sock_js_socket.js, line 244

##### Returns:

Type
  SocketAddress

#### pause() → {SockJSSocket}

Source:
  - vertx-web-js/sock_js_socket.js, line 109

##### Returns:

Type
  SockJSSocket

#### remoteAddress() → {SocketAddress}

Return the remote address for this socket

Source:
  - vertx-web-js/sock_js_socket.js, line 230

##### Returns:

Type
  SocketAddress

#### resume() → {SockJSSocket}

Source:
  - vertx-web-js/sock_js_socket.js, line 123

##### Returns:

Type
  SockJSSocket

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

##### Parameters:

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

Source:
  - vertx-web-js/sock_js_socket.js, line 169

##### Returns:

Type
  SockJSSocket

#### uri() → {string}

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

Source:
  - vertx-web-js/sock_js_socket.js, line 273

##### Returns:

Type
  string

#### webSession() → {Session}

Source:
  - vertx-web-js/sock_js_socket.js, line 286

##### Returns:

the Vert.x-Web session corresponding to this socket

Type
  Session

#### webUser() → {User}

Source:
  - vertx-web-js/sock_js_socket.js, line 299

##### Returns:

the Vert.x-Web user corresponding to this socket

Type
  User

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

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

##### Parameters:

Name | Type | Description
--- | --- | ---
`data` | string | the string to write

Source:
  - vertx-web-js/sock_js_socket.js, line 152

##### Returns:

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

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:
  - vertx-web-js/sock_js_socket.js, line 203

##### Returns:

Type
  string

#### writeQueueFull() → {boolean}

Source:
  - vertx-web-js/sock_js_socket.js, line 64

##### Returns:

Type
  boolean