Change occlient to cancel observe on every registration.
authorMandeep Shetty <mandeep.shetty@intel.com>
Tue, 6 Oct 2015 00:02:47 +0000 (17:02 -0700)
committerJon A. Cruz <jonc@osg.samsung.com>
Wed, 28 Oct 2015 08:09:40 +0000 (08:09 +0000)
commitc11a5b681ebd04b6d8dd423f7f6f155a7a4cb22e
treedc7e2ca6fa9a6851aabb4b3bc6c2f00db5b0e6a9
parent7c07a926bfa7751363431f317c7c62e2f6ef321b
Change occlient to cancel observe on every registration.

In the case when there are multiple servers, occlient sends out observer
requests to all of them. On reaching 15 notifications, only one of the
observation registrations were cancelled.
As the handle for cancellation was maintained in a global variable, none
of the others were cancelled and the client continued to get
notifications and this led to some failed tests.
Changed client behavior to cancel observe wit the handle present in the
response.

This can be cherry-picked to 1.0.0-dev

Change-Id: I51d28620b140dbb4f28baef7aa3be93276f6de5f
Signed-off-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3535
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
resource/csdk/stack/samples/linux/SimpleClientServer/occlient.cpp