Commit f99a2dc9 authored by Markus Jung's avatar Markus Jung Committed by Uze Choi

[IOT-1081] Fix for discoverying old resource servers

Catch ResourceInitException and ignoring old resource servers

Change-Id: Idd3dd3853cadc63aeb83a2ccaba54b1fd5de88a0
Signed-off-by: default avatarMarkus Jung <markus.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/7753Reviewed-by: default avatarMushfiqul Islam <i.mushfiq@samsung.com>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
parent afa1d7a5
......@@ -165,13 +165,19 @@ namespace OC
return OC_STACK_KEEP_TRANSACTION;
}
ListenOCContainer container(clientWrapper, clientResponse->devAddr,
reinterpret_cast<OCDiscoveryPayload*>(clientResponse->payload));
// loop to ensure valid construction of all resources
for(auto resource : container.Resources())
{
std::thread exec(context->callback, resource);
exec.detach();
try{
ListenOCContainer container(clientWrapper, clientResponse->devAddr,
reinterpret_cast<OCDiscoveryPayload*>(clientResponse->payload));
// loop to ensure valid construction of all resources
for(auto resource : container.Resources())
{
std::thread exec(context->callback, resource);
exec.detach();
}
}
catch (std::exception &e){
oclog() << "Exception in listCallback, ignoring response: "
<< e.what() << std::flush;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment