Jump to main content

##

# TCPIP_TFTPC_HandlerRegister Function

## C

    TCPIP_TFTPC_HANDLE TCPIP_TFTPC_HandlerRegister(
        TCPIP_NET_HANDLE hNet,
        TCPIP_TFTPC_EVENT_HANDLER handler,
        const void* hParam
    );

## Description

This function registers a TFTPC event handler. The TFTP client module will call the registered handler when a TFTP client event (TCPIP_TFTPC_EVENT_TYPE) occurs.

## Preconditions

The TFTP client module must be initialized.

## Parameters

Parameters | Description
--- | ---
hNet | Interface handle. Use hNet == 0 to register on all interface available.
handler | Handler to be called when a TFTP client event occurs.
hParam | Parameter to be used in the handler call. This is user supplied and is not used by the DHCP module.

## Returns

- A valid handle if the call succeeds.
- A null handle if the call failed (out of memory, for example).

## Remarks

The handler has to be short and fast. It is meant for setting an event flag, not for lengthy processing.

The hParam is passed by the client and will be used by the DHCP when the notification is made. It is used for per-thread content of if more modules, for example, share the same handler and need a way to differentiate the callback.