- TIBCO BusinessEvents®
- Standard
- HTTP
- WebSocket

# HTTP.WebSocket.closeConnection()

## Signature

`void closeConnection(Object eventOrSessionContext, int closeCode, String closeReason, boolean all)`

## Domain

ACTION, CONDITION, BUI

## Description

Closes single/all websocket connection/s to the underlying endpoint

## Parameters

Name | Type | Description
--- | --- | ---
`eventOrSessionContext` | `Object` | Accepts a SimpleEvent associated to WebSocket destination or the underlying websocket session context retrieved via getSessionContext api.
`closeCode` | `int` | Valid Websocket close code for closure.Few valid codes are 1001,1002,1003.
`closeReason` | `String` | Reason for the websocket close connection
`all` | `boolean` | Closes the current or all websocket connections associated to the underlying endpoint

## Returns

Type | Description
--- | ---
`void` |