[英]How to check if the server is available in POCO::Net
I have used this solution to load the frames of Ip Camera. 我已经使用此解决方案加载了Ip Camera的帧。 When the camera is not connected, I get exception.
未连接相机时,出现异常。 Is there a way to check if the camera is connected?
有没有办法检查相机是否已连接? In the other hand, can I check if my client can connect to server in the poco?
另一方面,我可以检查我的客户端是否可以连接到poco中的服务器?
Wrap your code in try/catch. 将您的代码包装在try / catch中。 If you get exception, something went wrong.
如果您遇到异常,则出了点问题。
try
{
//this will throw Poco::Net::ConectionRefusedException
session.sendRequest(req);
//...
}
catch(Poco::Net::ConectionRefusedException& ex)
{
// handle error
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.