Re: Two way channel roles?

"William J. Mills" <[email protected]> Mon, 20 Jan 2003 17:08:59 -0800
Newsgroups gmane.network.beep.beepcore.c.general
Message-ID <[email protected]>
Andy,

I'd say in the pure form of a p2p channel you can handle all of this
in a single channel.  The question is whether you wish to differentiate
the behavior of the profile based on the iniiator/listener status of that
channel.  You don't have to.

Probably the most confusing thing is that both the "client" and the "server"
in this case require that this channel be opened, and how do they agree on 
who starts it?  A good question...

It doesn't really matter if you handle it in one or 2 channels though,
I suspect.  I don't think it will reduce the possibility of a race.  I 
suppose you could institute some kind of token/lock in the channel for who 
gets to make the next change.  Also you might simple make an ERR condition
that says "There's an outstanding change on this setting that needs to be
completed first".

As for triggering a dtaa stream and then cancelling it, why not use 

I:	MSG 1 TriggerRequest
L:	ANS 1 1 data....
L:	ANS 1 2 data....
...
L:	ANS 1 N data....
I:	MSG 4 CancelTrigger     // cancel sent before processing the
TriggerEvent
L:	RPY 4 ok
L:	NUL 1 ok


Which would allow you to have multiple ANS streams runnign on the same 
channel, and then close them from either end as needed.

-bill


On Mon, Jan 20, 2003 at 05:08:40PM +0800, Andy Dent wrote:
> I'm a bit confused and hope someone doesn't mind clarifying these roles.
> 
> I have two situations where messages flow in two directions.
> 
> The first is where application settings are remotely configured - the
> client connects to the server, creates a Settings Channel and will send new
> Settings periodically, as the user changes the UI.
> 
> However, Settings can also be changed locally on the server, which will
> then send them back to the client.
> 
> Should this be two channels or one?
> 
> Similarly, Triggers are established by sending a TriggerRequest to the
> server, which will then send back a TriggerEvent every time data
> (brainwaves) matches the trigger parameters.
> 
> The client can send new TriggerRequests (or CancelTrigger messages)
> periodically but, once set, the bulk of the data flow will be in the
> opposite direction.
> 
> I *think* these are two profiles, each running over one channel. The
> Initiator vs Listener roles are clear in terms of who initiates the
> channel. I just get a little lost sometimes thinking of the sequencing of
> messages.
> 
> This is where the lack of really detailed examples has confused me when we
> get into race territory.
> 
> Take the example of the Triggers, say a client sends back a CancelTrigger
> after a Trigger has been running for a while - are both the following
> valid, which is what I've assumed?
> 
> 
> I:	MSG 1 TriggerRequest
> L:	RPY 1 ok
> L:	MSG 1 TriggerEvent
> I:	RPY 1 ok
> ...
> L:	MSG 1 TriggerEvent
> I:	MSG 4 CancelTrigger     // cancel sent before processing the
> TriggerEvent
> L:	RPY 4 ok
> I:	RPY 1 ok
> 
> OR
> L:	MSG 1 TriggerEvent
> I:	MSG 4 CancelTrigger     // cancel sent before processing the
> TriggerEvent
> I:	RPY 1 ok
> L:	RPY 4 ok  // Listener has received the MSG and RPY before having
> time to send the RPY
> 
> 
> thanks
> -- 
> 
> Andy Dent BSc  MACS  AACM   http://www.oofile.com.au/
> OOFILE - Database, Reports, Graphs, GUI for c++ on Mac, Unix & Windows
> PP2MFC - PowerPlant->MFC portability
> 
> 
> -------------------------------------------------------
> This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
> are you planning your Web Server Security? Click here to get a FREE
> Thawte SSL guide and find the answers to all your  SSL security issues.
> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
> _______________________________________________
> Beepcore-c-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/beepcore-c-users


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com