[muscle] Re: node path info

  • From: Jeremy Friesner <jaf@xxxxxxxxxxxx>
  • To: muscle@xxxxxxxxxxxxx
  • Date: Sat, 18 Jun 2005 13:54:22 -0700

Hi Wim,
On Saturday 18 June 2005 12:48, VANHERP Wim wrote:
> 1) Is there a way to subscribe to all possible node-paths  on the
> muscleserver  ?

Unless you want to customize the server to add that ability, no.
However, with the default server you can subscribe to all node-paths of a 
given depth in the tree....  so if you know in advance the maximum node depth 
your system will be using, you can just subscribe to all nodes at depths up 
to that depth, like this:

MessageRef msg = GetMessageFromPool(PR_COMMAND_SETPARAMETERS);
if (msg())
{
   msg()->AddBool("SUBSCRIBE:/*", false);  // subscribe to host names
   msg()->AddBool("SUBSCRIBE:/*/*", false);  // subscribe to session IDs
   msg()->AddBool("SUBSCRIBE:/*/*/*", false);  // subscribe to user depth #1
   msg()->AddBool("SUBSCRIBE:/*/*/*/*", false);  // user depth #2
   msg()->AddBool("SUBSCRIBE:/*/*/*/*/*", false);  // user depth #3  (etc)
[... and so on...]
   myMessageTransceiverThread->SendMessageToSessions(msg);
}

> 2) when a client has subscribed to receive messages from several nodes,
> is it possible to see from wich node-paths the message is that he
> receives ?

Every entry in the PR_RESULT_DATAITEMS Message contains the full path of the 
node it is associated with, so you can parse that path to figure out exactly 
which node it is referring to.  (e.g. "/192.168.0.101/1234/somenode" 
specifies the node named "somenode", owned by client session #1234, which is 
connecting in from a client at 192.168.0.101)

Or maybe I am misunderstanding the question?

> By the way,   your package is wonderfull, i'm still searching a bit of
> how i am going to implement it, but i'm very enthousiastic.

Thanks, I'm glad you like it.  Note that v3.00 will be out pretty soon, and it 
will change a few things, so watch out for that.

-Jeremy

Other related posts: