[muscle] SV: Re: MOM and DAD problem.

  • From: "David Svanberg" <ds@xxxxxxxxxxx>
  • To: <muscle@xxxxxxxxxxxxx>
  • Date: Fri, 15 Aug 2003 08:55:40 +0200

That might work.

What I did yesterday was to send a PR_COMMAND_GETPARAMETERS after the
"SUBSCRIBE" command. In the "case muscle::PR_RESULT_PARAMETERS" I process
the subscriptions I should have done and compares does with the msg( ):

muscle::String whatIShouldHaveSubscribedTo = ...;
if ( msg( )->FindBool( whatIShouldHaveSubscribedTo, &b ) == B_NO_ERROR )
{
  // Yes!
}
else
{
  // Hmmm...
}

But than I figured out that  - What should I do when I don't find the
whatIShouldHaveSubscribedTo string? (Or maybe I'll never reach that
situation?) Calling another PR_COMMAND_GETPARAMETERS would maybe result in
an infinite loop...(would it?). But I figured out that if my "SUBSCRIBE"
command was done before the first PR_COMMAND_GETPARAMETERS than in all cases
I've tried the subscription is valid when the PR_RESULT_PARAMETERS comes
back. First thing first... Is this behaviour guarateed by MUSCLE?

And when the subscription is valid I directly call the DAD client that I'm
ready.

It seems to work for me but I don't know if it's pretty.

/David


-----Opprinnelig melding-----
Fra: muscle-bounce@xxxxxxxxxxxxx [mailto:muscle-bounce@xxxxxxxxxxxxx]På;
vegne av Jeremy Friesner
Sendt: 14. august 2003 18:32
Til: muscle@xxxxxxxxxxxxx
Emne: [muscle] Re: MOM and DAD problem.


> When my client, MOM, do a
> "SUBSCRIBE:...the=5Ftime=5FI=5Fcome=5Fhome=5Ftoday=5Fafter=5Fwork..." to
my DAD client's
> data that he stores on the server I want to be informed when the
> subscripiton actually is done (is valid on the server). This is because I
> don't want that DAD should start updating his records before MOM actually
> subscribes. (DAD has a habit of changing his mind very often and MOM keeps
a
> record of all DAD's faults to summaries it for the client LAWYER (but that
> is another problem)...)

Hehehe... well, how about this... after MOM creates her subscription as
described above,
she then posts her own data node called "mom=5Fis=5Flistening".  DAD will
have already
subscribed to "SUBSCRIBE:mom=5Fis=5Flistening", so that when MOM posts her
node,
DAD will get notified of that fact, and so he will know it's now okay to
start posting
his data.

Will that work=3F

Jeremy







Other related posts: