my.closeSocket

Use this API to disable the WebSocket connection.

Sample Code

copy
my.onSocketOpen(function() {
  my.closeSocket()
})

my.onSocketClose(function(res) {
  console.log('The WebSocket is closed!')
})

Note:The case is only for reference. Please use your own URL to test.

Parameters

PropertyType

Required

Description
successFunctionNoThe callback function for a successful API call.
failFunctionNoThe callback function for a failed API call.
completeFunctionNo The callback function used when the API call is completed. This function is always executed no matter the call succeeds or fails.