Function

vmnet_interface_set_event_callback(_:_:_:_:)

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

Declaration

Current

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

Previous

func vmnet_interface_set_event_callback(_ interface: interface_ref, _ flags: interface_event_t, _ queue: DispatchQueue?, _ handler: ((interface_event_t, xpc_object_t) -> Void)?) -> vmnet_return_t

Parameters

interface

The interface reference.

flags

Flags indicating the events that the handler block will be called upon. See vmnet for possible values.

queue

The queue on which the handler is scheduled.

handler

A block to be executed after interface is started.

event_id

The type of event. See vmnet for possible values.

event

An XPC dictionary containing information about the event.

Possible keys are described in event XPC Dictionary.

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.