web.websocketClose

Closes a WebSocket connection.

ExampleMiscellaneous Functions

Syntax

web.websocketClose( {object] );

JavaScript Object

{  
    id:"<string>",
    code:"<string>,
    reason:"<string>"
}
Property Name
Description
idThe ID of the connection to close.
codeThe WebSocket connection close code. This can be an integer ranging from 1000 to 1011.
reasonA 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"
});;