Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Async Search and Query on contentDirectory C++
19-02-2015, 10:51 PM (This post was last modified: 20-02-2015 05:39 PM by ChriD.)
Post: #1
[Solved] Async Search and Query on contentDirectory C++
Hi,

This one is a common question and has literaly nothng to do with the OhNetStack i think.

In C# i can use Lamdas to add extra information for an async method
eg.

Code:
contentDirectory.Browse(..., (asyncHandle) => OnBrowseEnd(asyncHandle, 1));
contentDirectory.Browse(..., (asyncHandle) => OnBrowseEnd(asyncHandle, 2));

private void BrowseSink(IntPtr aAsyncHandle, int aOther)
{
// will be called twice with aOther has one time the value 1 and then the value 2
}

How can i do this in C++ with the OhNet AsyncFunctor?
Code:
OpenHome::Net::FunctorAsync functor = OpenHome::Net::MakeFunctorAsync(*this, &MediaServer::OnBrowseEnd);                    
this->GetContentDirectoryProxy()->BeginBrowse(_containerId, browseFlag, "*", 0, 0, "", functor);
Is this possible?

best regards
Chris
Find all posts by this user


Messages In This Thread
[Solved] Async Search and Query on contentDirectory C++ - ChriD - 19-02-2015 10:51 PM

Forum Jump: