0

I have used this solution to load the frames of 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?

Community
  • 1
  • 1
Smn
  • 71
  • 2
  • 10

1 Answers1

0

Wrap your code in 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
}
Alex
  • 5,159
  • 4
  • 25
  • 33