close method

Future<void> close(
  1. int code, [
  2. String? reason
])

Closes the current stream with code and reason.

Implementation

Future<void> close(int code, [String? reason]) async {
  final s = _current;
  if (s == null) return;
  s.closeFromServer(code, reason);
}