Monday, July 4, 2011

How to retrieve the port number of the AOS within a session

The port number used by an AOS server instance is of course set in the server configuration utility.

But what if you need to retrieve this information from within a session? Or what if you connect to a load balanced cluster and you need to know the currently used port number?
For these kind of questions, the Session class has an answer.  With the method getAOSPort.

See following example:
static void GetAOSPort(Args _args)
{  ;
   info(strfmt("Port number: %1",int2str(Session::getAOSPort())));
The Session class has some other nice informational methods, inherited from xSession. Like AOSName (retrieve the name of the AOS server) and clientComputerName (retrieves the network name of the client computer of the session).

No comments:

Post a Comment