Hi Mats:
Thanks for your reply.
I rewrite my question below: 

According to https://wiki.iotivity.org/resource_hosting, the Hosting flow
seems to be:
1. RH Server create RH Resource.
2. Original Server find RH and publish its resource to RH.
3. RH create a Virtual Resource at RH Server side for the Original Server.
4. RH subscribe to Original Server.
5. Original Server change its property as "un-discoverable".
6. Original Server notify the RH server when its attribute changed.
7. What all clients will discover is the Virtual Resource on RH.
8. If clients want to subscribe to the Origianl Server, they subscribe to
the Virtual Resource on RH.
9. RH is to substitute to response the notification.

If I have any misunderstanding about the RH Wiki, please let me know.

The samples that we refer to are:
Coordinator:
service/resource-hosting/SampleApp/linux/sampleResourceHosting/main.cpp
Provider:
service/resource-hosting/SampleApp/linux/sampleProvider/SampleProvider.cpp
Consumer:
ervice/resource-hosting/SampleApp/linux/sampleConsumer/SampleConsumer.cpp

And we would like to know if the samples go with the same flow as listed
above, i.e., as the RH WiKi describe. 

If the flow is the same, then our question about the samples can be
simplified as:
1. Where/How "RH server create its RH resource" is implemented?
2. Where/How "Original server find and publish its resource to RH" is
implemented?
Then we can trace other steps by ourselves.

Or, if the flow of samples is different from the listed flow above,
then which flow should we follow? Samples or RH Wiki?


Thank you.

Best Regards,
Annie

-----Original Message-----
From: Mats Wichmann [mailto:[email protected]] 
Sent: Tuesday, June 21, 2016 11:16 AM
To: Annie Weng; iotivity-dev at lists.iotivity.org
Subject: Re: [dev] About Resource Hosting Sample Code (Linux)

On 06/20/2016 08:53 PM, Annie Weng wrote:
> Hi All:
> 
> Our team is now studying the resource hosing service.
> 
> But it seems that the behavior of the sample code (for Linux) doesn't
match the flow diagram of RH's wiki page
(https://wiki.iotivity.org/resource_hosting).
> 
> According to the flow diagram, there should be 3 main steps:
> 
> 1.      RH server create RH resource.
> 2.      Original server find and publsh its resource to RH.
> 3.      Original server disable its discoverable property.
> 
> But we didn't find corresponding behaviors in RH's sample code.
> 
> It seems that the sample code go with a different flow.
> 
> Could someone help us about the correspondence between the Linux sample
code and the RH's flow diagram?

I wouldn't make too many assumptions about samples.

Generally speaking, resource hosting (resource directory - are there other
situations involved?) should mean a device has delegated another to respond
on its behalf for activities like discovery, so it doesn't have to stay
awake to respond to multicasts for that purpose; the resource always has a
URI which means it can be talked to directly when it matters.  What do you
see in the samples that doesn't match this?   (I don't know what's in the
samples you looked at, this is simply a question of "please elaborate")


Reply via email to