c++ - 如何使用 libnetconf2 的 nc_recv_reply 获取回复数据
问题描述
我正在尝试使用 nc_recv_reply 获取配置。所以基本上我正在做的是:
struct nc_reply_data* reply = NULL;
std::cout << "======Calling nc_recv_reply======" << std::endl;
type = nc_recv_reply(session, rpc, msgid, 300, 0, (struct nc_reply**)&reply);
std::cout << "======Finished calling nc_recv_reply======" << std::endl;
if(reply && type == NC_MSG_REPLY)
if(reply->type == NC_RPL_DATA)
{
if(reply->data)
std::cout<< "======Got data======"<<std::endl;
else
std::cout<< "======Couldn't get data======"<<std::endl;
}
else
std::cout<< "======Failure======"<<std::endl;
得到的是
======调用nc_recv_reply======
我应该收到的消息
======调用完nc_recv_reply======
======无法获取数据======
所以我的问题是如何获得我期待的 lyd_node*?
提前致谢 :)
解决方案
推荐阅读
- c# - 从控制器访问链接
- javascript - 有没有办法注册上下文点击但使用键盘?
- arduino - NodeMCU Arduino框架UDP数据包发送问题
- unit-testing - 如何将布尔值传递给期望语句以使用 mocha/chai 进行测试?
- sql - 如何在SQL中查找时间戳是早上,下午或晚上
- javascript - 如何使用 array.map 返回一个空数组
- tfs - 迁移后电子邮件中的 tfs url 错误
- haskell - 有没有办法直接引用 Haskell 中的类型类实例?
- google-apps-script - ScriptApp.newTrigger().forForm 问题
- sql-server - 在一对五的关系中识别具有多个不同值的记录