I have a function that runs in C. I would like for it to timeout, or at least be non blocking. Is there a way to do that without running it as a thread?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
select()(or one of its platform-specific equivalents) is what should be used if you don’t know that there is input available from a blocking file or socket, and want to continue if there isn’t.