disconnect method

void disconnect({
  1. int? delayMs,
})

delayMs: milliseconds to wait after destroying the socket

Implementation

void disconnect({int? delayMs}) async {
  _socket.destroy();
  if (delayMs != null) {
    await Future.delayed(Duration(milliseconds: delayMs), () => null);
  }
}