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: xPL Lib - updates


  • Subject: Re: xPL Lib - updates
  • From: "Mal Lansell" <mlansell@xxxxxxxxxxxxxx>
  • Date: Sat, 13 Nov 2004 20:29:23 -0000



--- In ukha_xpl@xxxxxxx, "John B" <home-automation@j...>
wrote:
> Hi Tom,
>
> > >
> > > If xpllib is running as a hub client (i.e. has bound to port
50,000+, it
> > > should only *ever* listen on the loopback address - this
ties
in with the
> > > hub which should only ever broadcast to the loopback
address.
> >
> > Ah, but it doesn't listen on the loopback address (which is
impossible
> > btw), it listens on IPAddress.Any
>
> Ah - I think you've uncovered a bit of a bug here... it should not
be listening on IPAddress.Any - it should be listening on the
loopback address only (unless it's bound directly to port 3865 of
course).
>
> Why is it impossible to listen on the loopback address
(IPAddress.Loopback)?
> Surely the loopback interface is treated the same as any other IP
interface?
>
> > <code_snippet>
> >     While Portnum < XPL_BASE_DYNAMIC_PORT + 512 And Not
Portnum =
0
> >       Try
> >         sockIncoming.Bind(New IPEndPoint(IPAddress.Any, Portnum))
> >         XPL_Portnum = Portnum
> > </code_snippet>
>
> Yep, definately a bug :-)
>

When I did my C++ code, it wouldn't work unless I used INADDR_ANY,
rather than the local IP.  I asked about it at the time - your
suggestion of binding to _ANY solved the problem (although I don't
pretend to know enough about sockets to know why).

Mal










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.