Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am implementing a server simulation program and want to check if anything was received via a recv from a TCP/IP socket witout waiting. When I place the MSG_DONTWAIT flag, recv returns a length of -1 and errno of "Resource temproarily anavialable". the call works when the MSG_WAITALL flag is used.

share|improve this question
    
Please read askubuntu.com/faq#questions. And I believe this question doesnt belong here –  thefourtheye Apr 23 '13 at 14:41
1  
@thefourtheye Development questions are allowed here see this question on meta. Though you may get a better response from a programming site such as: programmers.stackexchange.com/questions –  Warren Hill Apr 23 '13 at 15:24

1 Answer 1

This is not an error but an expected behavior. The documentation of MSG_DONTWAIT states:

If no data is available, then instead of blocking, return immediately with the error EAGAIN.

Which means that you should wait for and handle such situation.

Check here for the reference and here for a similar discussion.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.