views:

211

answers:

1

I get the error message "Resource temporarily unavailable" when I use the method receive_from(), it's a member of ip::udp::socket located here.

I pass to it: boost::asio::buffer, pointer to an endpoint object, flags (set to zero), and an error_code object.

I create the endpoint with just

 new udp::endpoint()

There doesn't seem to be too much information available on this error message too. I've tried it on several machines and always get this error.

+1  A: 

"Resource temporarily unavailable" is normally the text description for EAGAIN, indicating that the operation should be retried. In the case of UDP, it indicates that there isn't any data available at present, and you should try later.

It's generally worth looking at the man page for the underlying libc function; which is recvfrom in this case.

Dave Rigby
I see... I'm sending a packet with another program I wrote, which works fine as I can see the packet with tcpdump. So how is the data not available if it is received by the machine?
devin