MongoDB c++连接后还要关闭吗
答案:1 悬赏:60
解决时间 2021-02-17 17:54
- 提问者网友:遮云壑
- 2021-02-17 03:46
MongoDB c++连接后还要关闭吗
最佳答案
- 二级知识专家网友:酒者煙囻
- 2021-02-17 03:52
while(true)
{
try{ DBClientConnection c;
c.connect("localhost");
c.query();
}
catch ()
{}
}
如果一直循环执行连接,会连接异常,提示:connect invalid socket errno:24 Too many open files terminate called after throwing an instance of 'mongo::ConnectException' what(): Can't connect couldn't connect to server localhost:27017
{
try{ DBClientConnection c;
c.connect("localhost");
c.query();
}
catch ()
{}
}
如果一直循环执行连接,会连接异常,提示:connect invalid socket errno:24 Too many open files terminate called after throwing an instance of 'mongo::ConnectException' what(): Can't connect couldn't connect to server localhost:27017
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯