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]

Hubs and Client connections


  • Subject: Hubs and Client connections
  • From: Stuart Booth
  • Date: Mon, 22 Dec 2003 13:51:00 +0000

James found an interesting issue with a pattern of xAP application
that pumps out multiple h/bs, but reuses the same port number to
reduce resource usage.

For instance, imagine a pair of source addresses:

Vendor.Device.Instance.Sub1 on port 3645
Vendor.Device.Instance.Sub2 on port 3645

It seems some hubs deal with this slightly different.

My own version inside xFx sees this as 2 separate clients because it
forms an internal key for each client connection based on the Port
number *and* the Logical Name part of the Source address (V.D.I.S, but
not including any h/w subs). It has done this since the very beginning
but I don't know why I did it that way.

At least one other hub sees this as a single connection, so I presume
it only checks Port number.

The result is that my Hub sends out each message multiple times on the
same client port, as it thinks there are multiple clients. In the case
above each message would be sent twice on port 3645.

I altered xFx to form a key for the client connection based only on
Port number and promptly found a possibly good reason not to do it
just on Port number.

When you use the GUI version of the Hub, only the first h/b will be
shown as a registered client, which just looks wrong. I want to see
all of the devices, even if they do share the same port.

I've 'fixed' this by altering the way the client connection key is
generated to use only the primary part of the logical name and not any
deeper subinstances. So from the example addresses above, I use:

Vendor.Device.Instance + Port 3645

Thus ignoring the Subinstance values. If these match then the Hub
records multiple clients, but flags the additional ones as not
requiring messages.

Sadly this seems a little complicated but achieves the results for
applications sitting atop the Hub protocol (such as the GUI Hub) that
I'd expect.

Any other suggestions, or could a note of this be made as
supplementary information on implementing a xAP Hub?

... and you read all the way this far? Nice one ;-)

S
--
Stuart Booth <<a
href="/group/xAP_developer/post?postID=UV-lV0DY_k6fy43mNb1BHos3j0yn4_70r5YmaIQnxhgHwWZpLyieeNyR5m_UL-HFXNG9cBYcaFHp2c5RhJKlqg">stuart@x...</a>>
xAPFramework.net - a xAP software development framework for .net

<a href="http://www.xapautomation.org/";>http://www.xapautomation.org/</a>
<a href="http://www.xapframework.net/";>http://www.xapframework.net/</a>





xAP_Development Main Index | xAP_Development Thread Index | xAP_Development 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.