---
title: "vmnet_interface_set_event_callback(_:_:_:_:)"
framework: vmnet
role: symbol
role_heading: Function
platforms: [Mac Catalyst 13.0+, macOS 10.10+]
path: "vmnet/vmnet_interface_set_event_callback(_:_:_:_:)"
---

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

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

## Declaration

```swift
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

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.

## See Also

### Starting and stopping interfaces

- [vmnet_start_interface(_:_:_:)](vmnet/vmnet_start_interface(_:_:_:).md)
- [vmnet_interface_start_with_network(_:_:_:_:)](vmnet/vmnet_interface_start_with_network(_:_:_:_:).md)
- [vmnet_stop_interface(_:_:_:)](vmnet/vmnet_stop_interface(_:_:_:).md)
