disconnect method

Future<void> disconnect()

Operation method that requests to close the Session opened against the configured Lightstreamer Server (if any).

When disconnect() is called, the "Stream-Sense" mechanism is stopped.
Note that active Subscription instances, associated with this LightstreamerClient instance, are preserved to be re-subscribed to on future Sessions.

Lifecycle Note that the request to disconnect is accomplished by the client in a separate thread; this means that an invocation to getStatus right after disconnect() might not reflect the change yet.
When the request to disconnect is finally being executed, if the status of the client is "DISCONNECTED", then nothing will be done.

⚠ WARNING ⚠ The completion of the returned Future indicates that the operation has been accepted and is in progress, but not necessarily completed. To receive notifications about events generated by the operation, it is necessary to register a ClientListener.

Implementation

Future<void> disconnect() async {
  return await _invokeMethod('disconnect');
}