Google is committed to advancing racial equity for Black communities. See how.

connect method

*<Null safety>*
  • @override

int connect (int flags, int mode, InterfaceRequest request, [int parentFlags = Flags.fsRights]) override

Connects to this instance of PseudoFile and serves over fidl.


int connect(int flags, int mode, fidl.InterfaceRequest<Node> request,
    [int parentFlags = Flags.fsRights]) {
  if (_isClosed) {
    sendErrorEvent(flags, ZX.ERR_NOT_SUPPORTED, request);
  // There should be no MODE_TYPE_* flags set, except for, possibly,
  // MODE_TYPE_FILE when the target is a pseudo file.
  if ((mode & ~modeProtectionMask) & ~modeTypeFile != 0) {
    sendErrorEvent(flags, ZX.ERR_INVALID_ARGS, request);

  var connectFlags = filterForNodeReference(flags);
  var status = _validateFlags(parentFlags, connectFlags);
  if (status != ZX.OK) {
    sendErrorEvent(connectFlags, status, request);
    return status;

  var connection = _FileConnection(
      capacity: _capacity,
      flags: connectFlags,
      file: this,
      mode: mode,
      request: fidl.InterfaceRequest<File>(request.passChannel()));

  // [connection] will also send on_open success event.
  return ZX.OK;