我刚刚更新了 boost 库,1.68.0
以1.70.0
获取(beast) websocket ssl client async example中的超时操作。
在上面的链接中,您将看到:
void
on_resolve(
beast::error_code ec,
tcp::resolver::results_type results)
{
if(ec)
return fail(ec, "resolve");
// Set a timeout on the operation
beast::get_lowest_layer(ws_).expires_after(std::chrono::seconds(30));
// Make the connection on the IP address we get from a lookup
beast::get_lowest_layer(ws_).async_connect(
results,
beast::bind_front_handler(
&session::on_connect,
shared_from_this()));
}
有不止一个函数使用这种结构来处理超时。对于我的代码(在 eclipse-cdt 中,我看到它是这样的
错误说(当鼠标指针悬停在expires_after或async_connect上):
无法解析方法“expires_after”或无法解析
方法“async_connect”
当鼠标指针被接管“get_lowest_layer”时,错误说
无效参数'
候选者是:
boost::beast::detail::lowest_layer_type_impl<#0,bool74 0 value 43 8 2 201 2
boost::beast::detail::has_next_layer_impl
boost::beast::detail::has_next_layer_impl 1 # 0 0 71 4417 0 0>::type & get_lowest_layer(#0 &) '
我想知道我需要为此链接一些库。我不知道是哪一个。 有什么建议么?