# Class: StompClient

## vertx-stomp-js/stomp_client~ StompClient

#### new StompClient()

Defines a STOMP client.

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

### Methods

#### close()

Closes the client.

Source:
  - vertx-stomp-js/stomp_client.js, line 157

#### connect(port, host, net, resultHandler) → {StompClient}

Connects to the server.

##### Parameters:

Name | Type | Description
--- | --- | ---
`port` | number | the server port
`host` | string | the server host
`net` | NetClient | the NET client to use
`resultHandler` | function | handler called with the connection result

Source:
  - vertx-stomp-js/stomp_client.js, line 49

##### Returns:

the current StompClient

Type
  StompClient

#### errorFrameHandler(handler) → {StompClient}

A general error frame handler. It can be used to catch `ERROR` frame emitted during the connection process (wrong authentication). This error handler will be pass to all StompClientConnection created from this client. Obviously, the client can override it when the connection is established.

##### Parameters:

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

Source:
  - vertx-stomp-js/stomp_client.js, line 141

##### Returns:

the current StompClient

Type
  StompClient

#### isClosed() → {boolean}

Source:
  - vertx-stomp-js/stomp_client.js, line 196

##### Returns:

whether or not the client is connected to the server.

Type
  boolean

#### options() → {Object}

Source:
  - vertx-stomp-js/stomp_client.js, line 170

##### Returns:

the client's options.

Type
  Object

#### receivedFrameHandler(handler) → {StompClient}

Configures a received handler that gets notified when a STOMP frame is received by the client. This handler can be used for logging, debugging or ad-hoc behavior. The frame can still be modified at the time.

When a connection is created, the handler is used as StompClientConnection#receivedFrameHandler.

##### Parameters:

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

Source:
  - vertx-stomp-js/stomp_client.js, line 101

##### Returns:

the current StompClient

Type
  StompClient

#### vertx() → {Vertx}

Source:
  - vertx-stomp-js/stomp_client.js, line 183

##### Returns:

the vert.x instance used by the client.

Type
  Vertx

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

Configures a writing handler that gets notified when a STOMP frame is written on the wire. This handler can be used for logging, debugging or ad-hoc behavior. The frame can still be modified at the time.

When a connection is created, the handler is used as StompClientConnection#writingFrameHandler.

##### Parameters:

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

Source:
  - vertx-stomp-js/stomp_client.js, line 122

##### Returns:

the current StompClient

Type
  StompClient