# Class: StompServer

## vertx-stomp-js/stomp_server~ StompServer

#### new StompServer()

  Source:
    - stomp_server.js, line 32

### 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:
    - stomp_server.js, line 147

  ##### 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:
    - stomp_server.js, line 109

#### 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:
    - stomp_server.js, line 44

  ##### Returns:

  the current StompServer
  Type
    StompServer

#### isListening() → {boolean}

  Checks whether or not the server is listening.
  Source:
    - stomp_server.js, line 131

  ##### 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:
    - stomp_server.js, line 62

  ##### Returns:

  the current StompServer
  Type
    StompServer

#### options() → {Object}

  Source:
    - stomp_server.js, line 161

  ##### Returns:

  - the server options
  - Type
      Object

#### stompHandler() → {StompServerHandler}

  Source:
    - stomp_server.js, line 189

  ##### Returns:

  - the StompServerHandler used by this server.
  - Type
      StompServerHandler

#### vertx() → {Vertx}

  Source:
    - stomp_server.js, line 175

  ##### Returns:

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