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: Socket problems




John,
That is not entirely correct.

Suppose the pc has 2 network cards, one has IP1 the other IP2.  IP1 is
the address you will be using for xPL because maybe that is the local
LAN and other devices are connected via that LAN.

The ListenOnAddress in the registry must then be set to IP1.

All traffic should remain "at that side", i.e. going via network
card with IP1.

The hub will be listening on IP1 port 3865.

Packets the hub receives will be checked against ListenToAddress.
This is just a security check.

The received packet is forwarded to the xPL apps that have registred
to the hub (automatically via their heartbeat messages).  The packets
are sent to the ports these apps are listening on (portnum 5000+).  If
ListenOnAddress is set to a specific address, then that address is
used as the source address otherwise the loopback address.  In this
example the message will be sent to IP1 port 5000 via a broadcast from
IP1.

If you do not set the source address but use the loopback address to
broadcast from then Windows picks a network card seemingly random to
send the packet from.  But if you happen to have a firewall between
IP1 and IP2 the packets may never arrive.  (I am not an expert, but
this is what I saw happening...)

The application that is listening on IP1 port 5000 will receive the
package and check it against ListenToAddress.  If it passes that last
check it will finally arrive at the application level.

In the current implementation of the .Net xpllib all traffic stays
neatly "on one side" of the PC (having 2 network cards).  The
firewall
doesn't log suspicious packets trying to get out nor does it block
packets broadcast from the wrong IP.

hth,
Tom


On Mon, 21 Mar 2005 07:27:23 -0000, John B
<home-automation@xxxxxxx> wrote:
> > I'm trying to get my C++ code working with the xPL network
> > settings (ListenOnAddress etc).
> >
> > Everything works fine if I bind my socket to INADDR_ANY, but
> > if I use the local IP address (in my case 192.168.0.10),
> > nothing is received.
>
> Can I just clarify something:
>
> The listenon address is only of any use if you are the hub.
> If you're a hub client, you should be binding to 127.0.0.1, and
ignoring
> the listenon address.
>
> Hubs send out packets on 127.0.0.1 to their hub clients - could this
be
> why Ethereal isn't seeing them?
>
> Regards,
>
> John
>
>
> xPL Links: http://www.xplproject.org.uk http://www.xplhal.com
> http://www.xpl.myby.co.uk
> To Post a Message: ukha_xpl@xxxxxxx
> To Subscribe:  ukha_xpl-subscribe@xxxxxxx
> To Unsubscribe:  ukha_xpl-unsubscribe@xxxxxxx
>
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
>
> ________________________________
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/ukha_xpl/
>
> To unsubscribe from this group, send an email to:
> ukha_xpl-unsubscribe@xxxxxxx
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


xPL Links: http://www.xplproject.org.uk http://www.xplhal.com http://www.xpl.myby.co.uk
To Post a Message: ukha_xpl@xxxxxxx
To Subscribe:  ukha_xpl-subscribe@xxxxxxx
To Unsubscribe:  ukha_xpl-unsubscribe@xxxxxxx

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.