close method

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

Closes the connection.

code has to be 1000 or in the application range 3000-4999; see WebSocketClose for the ones this package sends.

Implementation

Future<void> close([int code = WebSocketClose.normal, String? reason]) =>
    channel.sink.close(code, reason);