Skip to main content

fdf_token_register

Function fdf_token_register 

Source
pub unsafe extern "C" fn fdf_token_register(
    token: zx_handle_t,
    dispatcher: *mut fdf_dispatcher_t,
    handler: *mut fdf_token_t,
) -> zx_status_t
Expand description

Registers a token transfer handler for |token|.

Note: This function is deprecated and will be removed at a later date. You should use |fdf_token_receive| instead.

The transfer handler will be scheduled to be called on the dispatcher when a client calls |fdf_token_transfer| with the channel peer of |token|, If the connection has already been requested, the handler will be scheduled immediately.

Transfers ownership of |token| to the runtime.

All handles are consumed and are no longer available to the caller, on success or failure.

ยงErrors

ZX_ERR_BAD_HANDLE: |token| is not a valid channel handle.

ZX_ERR_INVALID_ARGS: |handler| or |dispatcher| is NULL.

ZX_ERR_BAD_STATE: The dispatcher is shutting down, or |handler| has already been registered.