disconnect method
timeout
: milliseconds to wait after closing the socket
Implementation
Future disconnect({Duration? timeout}) async {
await socket?.flush();
await socket?.close();
if (timeout != null) {
await Future.delayed(timeout, () => null);
}
}