onclose abstract method

void onclose(
  1. void callback(
    1. Object? error
    )
)

Registers a handler that will be invoked when the connection is closed.

callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any).

Implementation

void onclose(void Function(Object? error) callback);