JavaScript Functions > Alphabetical Listing of Web Functions > web.websocketClose

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"
});;