close method
Close the transport.
Implementation
@override
Future<void> close() async {
if (_closed) return;
_closed = true;
_poller?.cancel();
_poller = null;
final bindings = _bindings;
final port = _portHandle;
if (bindings != null && port != null) {
bindings.xlDeactivateChannel(port, accessMask);
bindings.xlClosePort(port);
bindings.xlCloseDriver();
}
final rx = _rxCtrl;
if (rx != null && !rx.isClosed) await rx.close();
final ev = _rxEvents;
if (ev != null) malloc.free(ev);
final cnt = _rxCount;
if (cnt != null) malloc.free(cnt);
_open = false;
}