[Message Prev][Message
Next][Thread Prev][Thread Next][Message
Index][Thread Index]
Re: Re: xPL Monitor: triple msgs
Hi Jon,
> > In a pc with more than 1 network card
> > the xPL Hub listens to all cards, no ? In a real world scenario
you
> > probably don't want this.
>
> It really depends on the user's set-up - binding to all interfaces
works
> well for 99% of users, and avoids them needing to know what their
primary
> address should be - it's not easy to reliably determine a host's
primary IP
> address - especially where dial-up networking is involved.
>
> Personally, I think the most robust approach is to continue to bind to
all
> interfaces by default, and make it easy for those users who have more
than
> one network interface to specify a primary IP to which the hub should
bind.
Isn't there also a security concern here if you open a port to traffic
coming from the internet ? If the lights start flashing you know a
hacker has found his way in :-)
It would be possible, wouldn't it ? Just send a correctly formed
packet to port 3865 with the command X10_ALL_LIGHTS_ON...
> > (In fact, I think I saw a few other possible improvements, but I
> > better shut up being a newbie on the list ;-)
>
> Please feel free to make any suggestions - it's nearly 2 years since
the hub
> was written - and the VB.NET version was itself taken from Tony's VB6
> version which itself had been through several phases of development.
Okay, you asked for it!
- drop the structure structXPLHub, use a class instead
- use a collection to store XPLHubs (maybe rename to XPLApps "en
passant") instead of a fixed size array
- put the IPAddress to bind to in the .config (ok, done ;-)
- put XPL_BASE_PORT and MAX_XPL_MSG_SIZE in the .config
- IsMsgLocal: check against the configured address instead
- rewrite the "find XPLHub in array" using collection logic
- send the message to the configured address not the loopback address
- add logic to remove XPLHubs from the collection: upon HBEAT.END and
if a time-out happens because no more heartbeats (then you can make
use of the otherwise unused "Refreshed" property stored in
XPLHub)
- maybe save state when the hub goes down so that it can be restarted
and immediately functions when it comes back up ?
I admit: no earth-shocking suggestions. It works great as it is now,
so why try to fix it. Maybe I'll implement the suggestions and then
forward the source to you. Then you can still ignore it ;-)
I'm enthousiastic about this whole xPL project. I'll definitely use it!
Regards,
Tom
xPL Main Index |
xPL Thread Index |
xPL Home |
Archives Home
|