start method

Future<void> start(
  1. String stateDir,
  2. String authKey,
  3. String hostname, {
  4. bool debugNetLogging = false,
})

Implementation

Future<void> start(
  String stateDir,
  String authKey,
  String hostname, {
  bool debugNetLogging = false,
}) async {
  // Only touch the lazily-resolved 0.6.0 symbol when the flag is on,
  // so the default path keeps working against a stale libtailscale.so.
  if (debugNetLogging) {
    _checkError(_setDebugNetLogging(1), 'START_FAILED');
  }
  final dirC = stateDir.toNativeUtf8();
  final keyC = authKey.toNativeUtf8();
  final hostC = hostname.toNativeUtf8();
  try {
    final err = _start(dirC, keyC, hostC);
    _checkError(err, 'START_FAILED');
  } finally {
    malloc.free(dirC);
    malloc.free(keyC);
    malloc.free(hostC);
  }
}