void valvula_io_waiting_set_wait_on_fd_group ( ValvulaCtx ctx,
ValvulaIoWaitOnFdGroup  wait_on 

Allows to configure the wait on fd group handler.

This handler allows to configure how is implemented a non-consuming resource on a given fd group.

The invoked function should return a selected error code according to the following values:

  • A timeout operation was received, then -1 should be returned.
  • A error has being received but the call loop should continue without paying attention to it, without checking for the sockets for its status, and to perform as soon as possible the same wait. This is used because current current default implementation, which used the IO "select" call could return because a signal was received. If the IO implemented doesn't require to implement this concept, just ignore it. Returned value should be -2.
  • A non recoverable error has happened, and valvula reader should exist. In this case -3 should be returned. This error code is also used by the internal valvula IO handler invocation to report that a wait handler haven't been defined.
  • No socket descriptor have change but it is required to perform again the blocking IO wait. Then 0 should be returned.
  • For the rest of the cases, the number of sockets could be returned by this function, however, this is not used by the Valvula Library. To report that a socket have changed (or a group of then inside the fd set), and you don't want to return how many sockets have changed, just return a positive value (1).
ctxThe context where the operation will be performed.
wait_onThe handler to be used. The function will fail on setting the handler if it is provided a NULL reference.