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

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

##### Parameters:

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

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

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

##### Returns:

Type
  MultiMap

#### localAddress() → {SocketAddress}

Return the local address for this socket

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

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

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

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

##### Returns:

Type
  string

#### webSession() → {Session}

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

##### Returns:

the Vert.x-Web session corresponding to this socket

Type
  Session

#### webUser() → {User}

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

##### Returns:

the Vert.x-Web user corresponding to this socket

Type
  User

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

##### Parameters:

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

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

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

##### Returns:

Type
  string

#### writeQueueFull() → {boolean}

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

##### Returns:

Type
  boolean