Websocket's close method doesn't work.

  1. describe your problem

after each timeline interaction, you need to stop the previous websocket connection to prevent the displayed query data from being instantly updated by the new data pushed back, so call the ws.close () method to close the websocket push every time you click the time query button. However, the close method does not take effect

Nov.10,2021

the close method of Websocket must be registered before it can take effect.

  var ws = new WebSocket(url);
  ws.onopen = function() {
      ws.send(JSON.stringify(param));
  }
  ws.onmessage = callback

  //closeclose
  ws.onclose = function() {}
Menu