# Class: StompServer

## vertx-stomp-js/stomp_server~ StompServer

#### new StompServer()

Source:
  - vertx-stomp-js/stomp_server.js, line 34

### Methods

#### actualPort() → {number}

Gets the port on which the server is listening.

This is useful if you bound the server specifying 0 as port number signifying an ephemeral port.

Source:
  - vertx-stomp-js/stomp_server.js, line 149

##### Returns:

the port

Type
  number

#### close(completionHandler)

Closes the server.

##### Parameters:

Name | Type | Description
--- | --- | ---
`completionHandler` | function | handler called once the server has been stopped

Source:
  - vertx-stomp-js/stomp_server.js, line 111

#### handler(handler) → {StompServer}

Configures the StompServerHandler. You must calls this method before calling the StompServer#listen method.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | StompServerHandler | the handler

Source:
  - vertx-stomp-js/stomp_server.js, line 46

##### Returns:

the current StompServer

Type
  StompServer

#### isListening() → {boolean}

Checks whether or not the server is listening.

Source:
  - vertx-stomp-js/stomp_server.js, line 133

##### Returns:

`true` if the server is listening, `false` otherwise

Type
  boolean

#### listen(port, host, handler) → {StompServer}

Connects the STOMP server to the given port / interface. Once the socket it bounds calls the given handler with the result. The result may be a failure if the socket is already used.

##### Parameters:

Name | Type | Description
--- | --- | ---
`port` | number | the port
`host` | string | the host / interface
`handler` | function | the handler to call with the result

Source:
  - vertx-stomp-js/stomp_server.js, line 64

##### Returns:

the current StompServer

Type
  StompServer

#### options() → {Object}

Source:
  - vertx-stomp-js/stomp_server.js, line 163

##### Returns:

- the server options
- Type
    Object

#### stompHandler() → {StompServerHandler}

Source:
  - vertx-stomp-js/stomp_server.js, line 191

##### Returns:

- the StompServerHandler used by this server.
- Type
    StompServerHandler

#### vertx() → {Vertx}

Source:
  - vertx-stomp-js/stomp_server.js, line 177

##### Returns:

- the instance of vert.x used by the server.
- Type
    Vertx

#### webSocketHandler() → {function}

Gets the able to manage web socket connections. If the web socket bridge is disabled, it returns `null`.

Source:
  - vertx-stomp-js/stomp_server.js, line 206

##### Returns:

the handler that can be passed to HttpServer#websocketHandler.

Type
  function

#### writingFrameHandler(handler) → {StompServer}

Configures the handler that is invoked every time a frame is going to be written to the "wire". It lets you log the frames, but also adapt the frame if needed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function | the handler, must not be `null`

Source:
  - vertx-stomp-js/stomp_server.js, line 221

##### Returns:

the current StompServer

Type
  StompServer