method WebSocket.closeprivateWebSocket.close(code?: number,reason?: string,): voidDeprecatedCloses the WebSocket connection, optionally using code as the WebSocket connection close code and reason as the WebSocket connection close reason. Parametersoptionalcode: numberoptionalreason: stringReturn Typevoid