Skip to main content

Product: OpenFusion JacORB

Version: 2.3

 

Description:

How to control the port a JacORB application uses?

 

Solution:

JacORB provides a number of socket factories to allow control over the socket creation on both the client and the server side.

On the server side JacORB uses the following properties to control the creation of sockets:

jacorb.net.server_socket_factory and jacorb.ssl.socket_factory.

By default JacORB will use:

jacorb.net.server_socket_factory = org.jacorb.orb.factory.DefaultServerSocketFactory

Control over the ports that the server is listening is provided by the two options below.

a) Set jacorb.net.server_socket_factory = FixedAddressSocketFactory

In conjunction with this you can set OAIAddr and OAPort.

OAIAddr will set the ip-address, this is usually used on a multihomed host.

OAPort will set the server listen port.

b) Set jacorb.net.server_socket_factory = org.jacorb.orb.factory.PortRangeServerSocketFactory

In conjunction with this set:

jacorb.net.server_socket_factory.port.min=15000
jacorb.net.server_socket_factory.port.max=15010

This will cause the server to open a listen port on one of the ports in the specified range.

If using SSL use:

jacorb.ssl.server_socket_factory = org.jacorb.security.ssl.sun_jsse.SSLServerSocketFactory

Control the server listen port by using:

OASSLPort=4711

On the client side define the socket factory by using jacorb.net.socket_factory

By default this is set to

jacorb.net.socket_factory = org.jacorb.orb.factory.DefaultSocketFactory

Control the ports that the client listens on by using

jacorb.net.socket_factory = org.jacorb.orb.factory.PortRangeSocketFactory

in conjunction with:

jacorb.net.socket_factory.port.min=14000
jacorb.net.socket_factory.port.max=14010

Which will create a client side port in this range.

If you are using SSL you need to use:

jacorb.ssl.socket_factory = org.jacorb.security.ssl.sun_jsse.SSLSocketFactory

Currently there is no way to set a defined port on the client side when using SSL.


#OpenFusion
#KnowledgeDocs