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 Operations




Hi Michael

Michael McSharry wrote:

> I've been using the xapFramework hub and viewer and have the problems
> of message duplication.  To better understand what is happening I
> wrote a hub application based upon what I understood from the spec and
> Patrick Lidstone feedback.  With my hub I no longer get the duplicate
> messages.

Interesting

> It is my understanding that the hub should use 127.0.0.1 to retransmit
> messages to all xap applications on the same PC.  I see this as the
> From interface in the xapFramework viewer when I run my hub, but when
> I run the xapFramework hub I see 192.x.x.x. as the message From.  It
> looks as if the xapFramework hub is using the primary interface for
> retransmission.  I do not know which is right or wrong, but I'm just
> trying to get my system working without duplicate messages.  Is there
> concensus on how the hub should operate?


I think all local traffic between applications on one machine should be
via the loopback address - this (as I understood it) would avoid the
packets appearing on the network elsewhere as traffic.

>
> What is also interesting is that the viewer on machine X reports that
> is sees the viewer on machine Y via  the 127.0.0.1:3639 interface.  I
> was not aware message sent on the loopback interface were visible on
> other computers.  What does the xapFramework viewer use to determine
> the From column in the display?


Hmmm - sort of doesn't tie in with how I thought it would work above
does it....

>
> In my hub implementation  messages received on the primary interface
> (port 3639) are sent on 127.0.0.1 to the subscribed port of each
> applicaton on the hub's PC using the port that the application
> indicated to which is was bound in the heartbeat message.  All
> applications send their messages on the primary interface to port
> 3639.  I think these messages will be seen by the local hub and any
> other computers on the primary LAN.


Sounds right

>
> Related question ....
>
> In a PC desktop application is generally the case that more than one
> xap application will be running.  If this is the case then why will
> the desktop application grap port 3639 and prevent normal xap
> opeations until manually stopped?  It seems that a PC application
> should pick some other port then eventually become active when the hub
> function comes online.

If it is a listener then it has to grab port 3639 or use a hub otherwise
it would be deaf - however if it was a send only application it could
grab any port and would work. This was to allow a single application to
run without a hub - however I agree that most times there will be two
apps running and so it would be helpful if it didnt pinch 3639 - leaving
that free for a hub to step in even if launched after the app.
Originally the single app able to run without a hub was more frequent -
maybe today apps should say ' No hub detected' when launched (if
appropriate) and force a manual intervention by the user to use 3639 -
otherwise they would use an ephemeral port.

Kevin

>





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.