Skip to main content

Product: OpenFusion TAO
Version: 1.4

Description:

How to run a server /client on a fixed port?

 

Resolution:

It is possible to control the port that is allocated. To do this you need to use the -ORBEndpoint option

This takes the form:

-ORBEndpoint iiop://hostname:port/foobar=50

For example to start a server with an executable called server and get it to use the port 1800 you need to use a command of the form

server -ORBEndpoint iiop://1.0@localhost:1800

If the port is in use you will get a BAD_PARAM exception thrown.

To specify ports from a predefined range are used you can use the portspan option. This takes the form

-ORBEndpoint iiop://[hostname]:initialPort/portspan=span

initialPort is the first port in the range and portspan=span is the range you want to use. The range must be between 1 and 65535

For example this command will do the following

-ORBEndpoint iiop://1.0@localhost:1800/portspan=5

It will attempt to start a server on the port 1800, if that port is in use it will try port 1801 and so on, until it reaches port 1805. At this point it has exhausted the range and will throw a BAD_PARAM exception.

You will find more information in the html documentation supplied with the distribution.


#OpenFusion
#OpenFusionTAO
#KnowledgeDocs