# Class: StompServerConnection

## vertx-stomp-js/stomp_server_connection~ StompServerConnection

#### new StompServerConnection()

Class representing a connection between a STOMP client a the server. It keeps a references on the client socket, so let write to this socket.

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

### Methods

#### close()

Closes the connection with the client.

Source:
  - vertx-stomp-js/stomp_server_connection.js, line 105

#### configureHeartbeat(ping, pong, pingHandler)

Configures the heartbeat.

##### Parameters:

Name | Type | Description
--- | --- | ---
`ping` | number | ping time
`pong` | number | pong time
`pingHandler` | function | the ping handler

Source:
  - vertx-stomp-js/stomp_server_connection.js, line 147

#### handler() → {StompServerHandler}

Source:
  - vertx-stomp-js/stomp_server_connection.js, line 78

##### Returns:

- the STOMP server handler dealing with this connection
- Type
    StompServerHandler

#### onServerActivity()

Notifies the connection about server activity (the server has sent a frame). This method is used to handle the heartbeat.

Source:
  - vertx-stomp-js/stomp_server_connection.js, line 132

#### ping()

Sends a `PING` frame to the client. A `PING` frame is a frame containing only `EOL`.

Source:
  - vertx-stomp-js/stomp_server_connection.js, line 118

#### server() → {StompServer}

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

##### Returns:

- the STOMP server serving this connection.
- Type
    StompServer

#### session() → {string}

Source:
  - vertx-stomp-js/stomp_server_connection.js, line 92

##### Returns:

- the STOMP session id computed when the client has established the connection to the server
- Type
    string

#### write(buffer) → {StompServerConnection}

Writes the given buffer to the socket. This is a low level API that should be used carefully.

##### Parameters:

Name | Type | Description
--- | --- | ---
`buffer` | Buffer | the buffer

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

##### Returns:

the current StompServerConnection

Type
  StompServerConnection