Added a two second delay before calling OcPlatform.startPresence() on the server side.
This gives the client side ample time to have the presence listener in place for expected
good behavior.
Change-Id: I0bc63b157c756abb510c3e2fb9651c3e14503b31
Signed-off-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13969
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
resourceFoundListener);
//server
+ //wait 2 seconds for the client's resourceFoundListener to set the presenceListener.
+ //the presenceListener must be set before startPresence() is called to get notified.
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ Log.e(TAG, e.getMessage());
+ }
OcPlatform.startPresence(OcPlatform.DEFAULT_PRESENCE_TTL);
//wait for onPresence event