Function gnunet_sys::GNUNET_SCHEDULER_add_read_net[][src]

pub unsafe extern "C" fn GNUNET_SCHEDULER_add_read_net(
    delay: GNUNET_TIME_Relative,
    rfd: *mut GNUNET_NETWORK_Handle,
    task: GNUNET_SCHEDULER_TaskCallback,
    task_cls: *mut c_void
) -> *mut GNUNET_SCHEDULER_Task

Schedule a new task to be run with a specified delay or when the specified file descriptor is ready for reading. The delay can be used as a timeout on the socket being ready. The task will be scheduled for execution once either the delay has expired or the socket operation is ready. It will be run with the DEFAULT priority. Only allowed to be called as long as the scheduler is running, that is one of the following conditions is met:

  • #GNUNET_SCHEDULER_run has been called and has not returned yet
  • #GNUNET_SCHEDULER_driver_init has been run and #GNUNET_SCHEDULER_driver_done has not been called yet

@param delay when should this operation time out? @param rfd read file-descriptor @param task main function of the task @param task_cls closure of @a task @return unique task identifier for the job only valid until @a task is started!