Changing the Default Port of the License Manager

By default, the License Manager communicates at port number 5093. If required, you can set it to any other available port using the information provided in this topic.

In case of standalone licensing, since the License Manager module is part of the licensing library itself, the default port of the License Manager need not be changed.

Executables to Rebuild

>The License Manager executable needs to be rebuild.

>The client application.

Description

Sets a new port number for the client-License Manager communication.

Function Prototype

int VLSchangePortNumber
(
   int  currentPort     
);

Returns

Returns the new port number set for the client-License Manager communication.

Parameter

Description

currentPort

An IN parameter.

The current port number used for communication.

Steps to Perform 

> Create the VLSchangePortNumber function.

> Update the CHANGE_PORT_OBJS variable in the custom32.mak file.

>Call VLSsetServerPort in the client application. You can use the VLSgetServerPort function to obtain the current port number.

>Follow the procedure described in How to Use the custom32.mak File?.

Code Snippet 

The VLSchangePortNumber Function

int VLSchangePortNumber
(
   int currentPort      /* IN  - Currently configured port number */
)
{
   int newPort = /* TODO: add new registered port number here */;
   return newPort;
}

The Client Application

int main(int argc, char* argv[])
{
   VLSsetServerPort(6000/*dummy port number*/);
   VLSinitialize();
   /* application code here */
   return 0;
}

Modifying the Default Port of RMS Utilities

If the default communication port of the License Manager is modified, the following RMS utilities (meant for redistribution) must also be modified to reflect this change:

>lsmon

>lslic

>lswhere

To modify the default port of RMS utilities:

>Edit the default port using the VLSsetServerPort API.

>Rebuild the utilities.

The source code of these utilities is provided in the ...\Samples\C\Src directory for Windows and in the .../samples/c/src directory for UNIX.

Communicating with the License Manager on a Non-default Port

Apart from calling the VLSchangePortNumber API, alternatively, the system administartor can change the License Manager port using the:

>LSPORT environment variable

>-port License Manager start-up option

However, changing the License Manager port alone does not allow communication with the client. The new non-default port must also be changed in the licensed application and utilities (which, by default, contacts the License Manager at port 5093). This change is not allowed on the system administartor-end to prevent cases of license duplication. This change must be performed by the vendor.