silc_schedule_task_add_fd

SYNOPSIS

    SilcTask
    silc_schedule_task_add_fd(SilcSchedule schedule, SilcUInt32 fd,
                              SilcTaskCallback callback, void *context);

DESCRIPTION

Add file descriptor task to scheduler. The `fd' may be either real file descriptor, socket or on some platforms an opaque file descriptor handle. To receive events for the file descriptor set the correct request events with silc_schedule_set_listen_fd function.

The task will be initially set for SILC_TASK_READ events. Setting that event immediately after this call returns is not necessary.

This returns the new task or NULL on error. If a task with `fd' has already been added this will return the existing task pointer.

If `schedule' is NULL this will call silc_schedule_get_global to try to get global scheduler.