The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: Hub Discussion



Howdy,

> If we agree, for example, that on Windows the hub service should have
> the service name of "xplhub", an app can easily check for
whether a hub
> is installed and warn the user if one is not found.

Not to be a pain, but not all frameworks are going to have access to a
system specific thing like access/interrogating the windows service list.
Since apps based on multiple frameworks are going to occur, while this
could
be done for apps that know how, I would suggest it not be the only/final
arbiter of whether there really is a hub or not.

> Likewise, an app can try binding to 3865 and warn the user if it
doesn't
> detect a hub.

Thats what I'm thinking -- when an app starts up (well, most likely, the
framework it's built on), it tries to bind to port 3865 and if it fails,
great -- assumes there is a hub.  If it succeeds, it immediately unbinds
and
informs the user that there is no hub and needs to be one.  Then exits.

There does exist a race condition though -- if multiple xPL apps are
starting at the exact same time, in the short time that appA has
successfully bound itself to port 3865 (i.e. there is no hub running) and
before it unbinds it, appB may be doing the same check and find port 3865
busy and conclude that there is a hub and start up.

While this is unlikely (the code can easily be written as two successive
system calls that will have the port open for only a millisecond or two),
we
need to be aware it can happen.

However, I think that this is probably not a show stopper.  At least one
app
(appA) will complain to the user that there is no hub and they need one.
While appB may start anyway, the user will probably reasonably expect
nothing will work until the hub is started (or installed and started).
Since appB will not be able to hear xPL traffic, that will sort of be the
case for appB anyway.

I'm going to write up a summary of what I *think* I'm hearing on the hub
issue and send it to the list for comment shortly.

Gerry

--
Gerry Duprey
Ann Arbor, MI 48103
http://www.cdp1802.org



xPL Main Index | xPL Thread Index | xPL Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.