closeTunnel method

Future<TunnelCloseResult> closeTunnel(
  1. String tunnelRef
)

Closes the caller's tunnel tunnelRef (a full id or unambiguous prefix).

Implementation

Future<TunnelCloseResult> closeTunnel(String tunnelRef) {
  _ensureConnected();
  final id = newId();
  final completer = Completer<TunnelCloseResult>();
  _pendingTunnelCloses[id] = completer;
  _connection!.send(
    ControlFrame(TunnelCloseRequest(requestId: id, tunnelRef: tunnelRef)),
  );
  return completer.future;
}