On 2012-04-11, Don Y <> wrote:
>
> Since I can't know what all clients will require over the
> length of a session -- nor the lifetime of the product -- I
> allow clients and servers to *negotiate* their contracts
> at the start of each session. If a service can't provide
> the characteristics that the client requires, the client
> balks and refuses to run (at that time).
I suspect you are trying to overengineer this - thowing too much
into one basket. It seems to me that this problem has two distinct
elements: firstly negotiating the parameters for an individual
session and secondly advertising new capbilities to clients that
may or may not be connected.
The first case is well understood by looking at prior art - the
Telnet protocol's "do, don't, will, won't" system for example is
fairly simple, robust and easily understood.
The second element doesn't really need to go into detail - it's
enough to simply state "The options available have now changed"
and let the clients perform an exploratory connect to investigate
whether the services on offer are now available. If you want to
cut down the number of investigatory connects you can always
summarise the options (or just the changes) in the rest of the
packet - there's no reason it can't just contain "will, won't"
messages that leverage the existing options negotiating code. In
that case problems of resource contention can be alleviated simply
be a change in semantics - options advertised are advisory until
such time as they are actually committed to in a particular session.
As for how to get this message to the client, obviously a lot
depends on the circumstances. Personally I wouldn't be too keen
on any "subscriptions" to receive updates if you can avoid it simply
because that open up so many more cans of worms. It would seem to
me that multicast would be the cleanest way by far, but of course
that limits you to a single subnet unless you want to jump through
more hoops.
--
Andrew Smallshaw