<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "vmnet",
  "identifier" : "/documentation/vmnet/vmnet_interface_set_event_callback(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "vmnet"
    ],
    "preciseIdentifier" : "c:@F@vmnet_interface_set_event_callback"
  },
  "title" : "vmnet_interface_set_event_callback(_:_:_:_:)"
}
-->

# vmnet_interface_set_event_callback(_:_:_:_:)

Schedules a callback to be executed when events for the specified interface are received.

```
func vmnet_interface_set_event_callback(_ interface: interface_ref, _ event_mask: interface_event_t, _ queue: dispatch_queue_t?, _ callback: vmnet_interface_event_callback_t?) -> vmnet_return_t
```

## Parameters

`interface`

The interface reference.

`queue`

The queue on which the handler is scheduled.

## Return Value

Returns `vmnet` on success, or an error code on failure. See `vmnet` for possible values.

## Discussion

Once the block is set, the callback can be unset by calling the function again, specifying a `NULL` queue and a `NULL` handler.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)