Share this page

# web.websocketClose

Closes a WebSocket connection.

Example | Miscellaneous Functions

## Syntax

    web.websocketClose( {object] );

## JavaScript Object

    {
        id:"<string>",
        code:"<string>,
        reason:"<string>"
    }

Property Name | Description
--- | ---
id | The ID of the connection to close.
code | The WebSocket connection close code. This can be an integer ranging from 1000 to 1011.
reason | A string indicating the reason of the closure.

web.websocketClose closes the WebSocket connection to the server with the specified id. For a list of the callback functions, see WebSocket Callback Functions.

## Return Values

Not applicable

## Parameterization

Standard Parameterization is supported for all of this function's arguments.

## Example

    web.websocketClose({
       id:0,
       code:1000,
       reason:"OK"
    });;

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: