SilcTaskType
NAME
typedef enum { ... } SilcTaskType;
DESCRIPTION
SILC has three types of tasks, non-timeout tasks (tasks that perform
over file descriptors), timeout tasks and generic tasks (tasks that
apply to every file descriptor). This type is sent as argument for the
task registering function, silc_schedule_task_add.
SOURCE
typedef enum {
/* File descriptor task that performs some event over file descriptors.
These tasks are for example network connections. */
SILC_TASK_FD = 0,
/* Timeout tasks are tasks that are executed after the specified
time has elapsed. After the task is executed the task is removed
automatically from the scheduler. It is safe to re-register the
task in task callback. It is also safe to unregister a task in
the task callback. */
SILC_TASK_TIMEOUT,
/* Generic tasks are non-timeout tasks and they apply to all file
descriptors, except to those that have explicitly registered a
non-timeout task. These tasks are there to make it simpler and faster
to execute common code that applies to all connections. These are,
for example, receiving packets from network and sending packets to
network. It doesn't make much sense to register a task that receives
a packet from network to every connection when you can have one task
that applies to all connections. This is what generic tasks are for.
Generic tasks are not bound to any specific file descriptor, however,
the correct file descriptor must be passed as argument to task
registering function. */
SILC_TASK_GENERIC,
} SilcTaskType;
|