This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

wait_for_fds_ready() causing code to get stuck

So I am initializing the FDS but the program I guess stands in an infinite loop at wait_for_fds_ready():

This is not working. At the moment I have given a delay of 300ms and then do the rest of the initialization but I feel the process is not safe enough.

Let me  know if further information is required.

Parents Reply
  • Hi,

    Sorry for the misunderstanding, I read the question a bit too fast and thought you were asking about the registration of the handler. 

    Ameer Usman said:
    should I use wait_for_fds_ready() after performing each write?

     The FDS module is asynchronous which mean that each operations is not performed immediately on a return but rather scheduled in a queue.The event handler will generate a WRITE event when the write event has been performed successfully. I suggest that you check that the operation is performed by waiting for the event in the handler instead of using wait_for_fds_ready().

    regards

    Jared  

Children
No Data
Related