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: Port Mapping Questions


  • Subject: Re: Port Mapping Questions
  • From: John B
  • Date: Thu, 18 Mar 2004 06:51:00 +0000

Hi Stuart,

> xAPListeningIP" is the IP address that the application connects
to on
> the local machine. It finds a the first free port from 3639 and binds
> to that address for incoming data. It is this port number that it
> pumps out in the Port= parameter of its heartbeats, as you'd expect.

This is technically not how a TCP/IP application should operate.
Remember that xAP has only been allocated port 3639, so using ports 3640,
3641
etc. means you are using ports that have been reserved for use by other
protocols.
(indeed, if you went up high enough you'd reach 3865, which is the xPL port
:-))

If you can't bind on your protocol's allocated port, you should really
start
looking in the dynamic/private port range for a free port.
This basically means any port number from 49152 to 65535.

So, the approach I take is as follows:

- Try and bind to base port.
- If base port is already in use, try and bind at port 50,000 and keep
incrementing until we find a free port.

Only a minor point, but you never know what other apps may be installed on
a
persons computer that are using ports close to 3639.

Regards,

John






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.