onClose method

void onClose(
  1. dynamic reason
)

Called upon transport close. reason reason

Implementation

void onClose(reason) {
  destroy();

  // `nsps` and `sockets` are cleaned up seamlessly
  if (sockets.isNotEmpty) {
    for (var socket in List.from(sockets)) {
      socket.onClose(reason);
    }
    sockets.clear();
  }
  decoder.destroy(); // clean up decoder
}