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