我正在尝试像这样使用 boost::asio::local::stream_protocol::acceptor
:
accept_(getIOService(), endpoint_)
这个调用返回的错误是:
[exec] unknown file: Failure
[exec] C++ exception with description "bind: No such file or directory" thrown in the test body.
有人见过这个吗?
最佳答案
验证端点的路径是否正确。当我通常观察到这些错误时,这是一个路径相关的问题,例如当当前目录中不存在 tmp
目录时,使用 "tmp/example"
构造端点,因为我打算使用 "/tmp/example"
。
Boost.Asio 的异常(exception)是从 bind()
接收 ENOENT
的转换。 bind()
的手册页声明 ENOENT
表示:
A component of the pathname does not name an existing file or the pathname is an empty string.
关于c++ - boost::asio::local::stream_protocol::acceptor 抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15124836/