tcp property

  1. @override
Tcp tcp
latefinal

Implementation

@override
late final Tcp tcp = createTcp(
  // Offloaded to a helper isolate: dial is long (a tailnet round trip) and
  // contended (callers dial/status concurrently), so it must not block the
  // worker. See lib/src/worker/native_offload.dart.
  dialFn: (host, port, timeout) => _withNativeRuntime(
    (runtimeToken) => offloadTcpDial(
      runtimeToken: runtimeToken,
      host: host,
      port: port,
      timeout: timeout,
    ),
  ),
  // Offloaded like dial: bind admission joins the native first-`Up`
  // bootstrap, which must not park the worker FIFO.
  listenFn: (tailnetPort, tailnetHost) => _withNativeRuntime(
    (runtimeToken) => offloadTcpListenFd(
      runtimeToken: runtimeToken,
      tailnetPort: tailnetPort,
      tailnetHost: tailnetHost,
    ),
  ),
  closeListenerFn: (listenerId) =>
      _withWorker((worker) => worker.closeFdListener(listenerId: listenerId)),
);