startProxyHandle method

Future<({int handle, int localPort})> startProxyHandle(
  1. String remoteIP,
  2. int remotePort
)

Implementation

Future<({int handle, int localPort})> startProxyHandle(
  String remoteIP,
  int remotePort,
) async {
  final ipC = remoteIP.toNativeUtf8();
  final handleOut = malloc<Int64>();
  final portOut = malloc<Int32>();
  try {
    final err = _startProxyHandle(ipC, remotePort, handleOut, portOut);
    _checkError(err, 'PROXY_FAILED');
    return (handle: handleOut.value, localPort: portOut.value);
  } finally {
    malloc.free(ipC);
    malloc.free(handleOut);
    malloc.free(portOut);
  }
}