简体   繁体   English

Boost ASIO中的资源暂时不可用

[英]Resource temporarily unavailable in Boost ASIO

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 . 当我使用方法receive_from()时,我收到错误消息“资源暂时不可用”,它是位于 ip :: udp :: socket的成员。

I pass to it: boost::asio::buffer, pointer to an endpoint object, flags (set to zero), and an error_code object. 我传递给它:boost :: asio :: buffer,指向端点对象的指针,标志(设置为零)和一个error_code对象。

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. 我已经在几台机器上尝试过,并且总是收到此错误。

"Resource temporarily unavailable" is normally the text description for EAGAIN , indicating that the operation should be retried. “资源暂时不可用”通常是EAGAIN的文本描述,指示应重试该操作。 In the case of UDP, it indicates that there isn't any data available at present, and you should try later. 如果是UDP,则表明目前没有任何可用数据,您应该稍后再试。

It's generally worth looking at the man page for the underlying libc function; 通常值得在手册页中找到底层的libc函数; which is recvfrom in this case. 这是recvfrom在这种情况下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM