1. Jinu Nair
  2. PowerBuilder
  3. Thursday, 16 June 2022 19:18 PM UTC

Hi,

Can someone share the power script code for the below?

1. Fetch the global and local IP of the application used by the user during the runtime of Appeon web applicaiton.

2. Find the number of instances of the application in the Appeon server.

 

 

Thanks

Jinu Nair

Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Friday, 17 June 2022 06:40 AM UTC
  2. PowerBuilder
  3. # 1

Hi Jinu,

The function AppeonGetClientIP return the the internal IP address, which is provided in Appeon_workarounds.pbl, please refer to article below for details.
https://docs.appeon.com/ps2020/workarounds_and_api_guide/Appeon_Client_Functions_wag.html#AppeonGetClientIP_function

The function getSessionByID provides the external IP address, please refer to the article below for details.
https://docs.appeon.com/ps2020/workarounds_and_api_guide/ch04s01s04.html

Sample script:

AppeonDotNetComponent lnvo
any la_l[]
long ll_ret
string ls_clientID

ls_clientID = appeonGetClientID()
la_l[1] = ls_clientID // actually, can be empty and this will mean "take current session ID"
la_l[2] = ""

lnvo = Create AppeonDotNetComponent
lnvo.ComponentType = "4"
lnvo.TypeLib = ""
lnvo.ClassDescript = ""

ll_ret = lnvo.of_ExecInterface ("getSessionByID",la_l)
If ll_ret = 0 Then
MessageBox("Get session info successfully.", "Session info: " + string(la_l[2]))
End If

 

You can use getSessionCount to get the total number of active sessions in a specified PowerServer, please refer to the article below for details.
https://docs.appeon.com/ps2020/workarounds_and_api_guide/getSessionCount.html

Sample script:

String ls_servername,ls_appname,ls_sessioncontent

AppeonDotNetComponent loadDBList

Any la_l[]
Long lRet
string ls_text

//the IP and port of appeon server,such as 192.0.0.49:80;192.0.0.49:81. if it is empty, the sessions of all clusters will return
//for safety, it should remain empty string, if there are no clusters
ls_servername =''

//the app name, if it is empty, it will return the sessions of all apps
ls_appname = ''

la_l[1] = ls_servername //
la_l[2] = ls_appname //

loadDBList = Create AppeonDotNetComponent
loadDBList.ComponentType ="4"
loadDBList.TypeLib =""
loadDBList.ClassDescript = ""

lRet = loadDBList.of_ExecInterface("getSessionCount",la_l)

If lRet >= 0 Then
ls_text+= '~r~nsuccessfully'
//MessageBox("Get session count successfully.","exeucte status:"+string (loadDBList.ReturnValue)+",xml content:"+string(la_l[3]))
else
ls_text += '~r~nfailed'
End If

ls_text += '~r~n'+'servername:'+ls_servername+'~r~n'
ls_text += 'appname:'+ls_appname+'~r~n'
ls_text += 'session count:'+string(loadDBList.ReturnValue)+'~r~n'

destroy loadDBList

messagebox('', ls_text)

Regards,
Kai

Comment
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Thursday, 16 June 2022 19:40 PM UTC
  2. PowerBuilder
  3. # 2

Which version of PowerServer?

Comment
There are no comments made yet.
Jinu Nair Accepted Answer Pending Moderation
  1. Friday, 17 June 2022 03:24 AM UTC
  2. PowerBuilder
  3. # 3

Hi,

Poswerserver version: Appeon PowerServer 2020 Build 2758.00 64-bit Edition.

The purpose is to restrict the Global IP Range and Number of Users.

 

Thanks

Jinu Nair

 

Comment
There are no comments made yet.
Jinu Nair Accepted Answer Pending Moderation
  1. Friday, 17 June 2022 06:57 AM UTC
  2. PowerBuilder
  3. # 4

Dear Kai,

 

Thank you very much.

Let me try and share my feedback.

 

Regards

Jinu Nair

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.