disconnect abstract method

FutureOr<void> disconnect([
  1. int? code = 1000,
  2. String? reason = 'NORMAL_CLOSURE'
])

Closes the WebSocket connection. Set the optional code and reason arguments to send close information to the remote peer. If they are omitted, the peer will see No Status Rcvd (1005) code with no reason, indicates that no status code was provided even though one was expected. https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code

Implementation

FutureOr<void> disconnect(
    [int? code = 1000, String? reason = 'NORMAL_CLOSURE']);