Consultor Eletrônico



Kbase P96368: How to find the login broker a remote client initially connected to ?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   6/29/2005
Status: Verified

GOAL:

How to find the login broker a remote client initially connected to ?

GOAL:

How to find which login broker spawned a specific remote client server ?

GOAL:

How to find which remote client is connected to which remote server ?

GOAL:

Which VST to use to display information about client server connections ?

FIX:

When more than one login broker is started against a database, there is no immediate method of finding "which" login broker spawned a specific remote server that was needed for a remote client connection without explicitly defining a unique -minport -maxport range on each login broker. For example: (note, only relevant connection parameters to this discussion are listed here)

{primary login broker}:
proserve dbname <..startup parameters..> -S 4000 -minport 4010 -maxport 4050

{secondary login broker}:
proserve dbname -m3 <..startup parameters..> -S 5000 -minport 5010 -maxport 5050


The following 4GL example, using the _CONNECT and _SERVERS Virtual System Tables (VST), may then customised to find which login broker a remote client initially connected to by:
- the remote server that remote client is currently connected to and
- the port number of that remote client server in relation to the port number of the login broker.

/* BRO_SVR_USR.p */

FOR EACH _Servers WHERE _Servers._Server-Type <> "Inactive" BY _Servers._Server-PortNum:
DISP
_Server-Num LABEL "SVR_num"
_Server-Type LABEL " Server type"
_Server-Pid LABEL " PIDsvr"
_Server-PortNum LABEL " PORT#"
_Server-CurrUsers LABEL "CurrUsers"
_Server-Logins LABEL "Totalogins"
_Server-MaxUsers LABEL "-Ma"WITH 2 COL.
IF _Server-Type <> "Login" THEN DISP _Server-MaxUsers - _Server-CurrUser LABEL "remaining" WITH 2 COL.
IF _Server-Type = "Login" THEN _Server-Type:BGCOLOR = 7. ELSE
_Server-num:BGCOLOR = 14.
_Server-portnum:BGCOLOR = 12.
DISP SKIP(1).
FOR EACH _Connect WHERE _Connect._Connect-Server = _Servers._Server-Num BY _Connect-Time:
DISP

_CONNECT-Server LABEL "SVR"
_CONNECT-Type LABEL "TYPE"
_CONNECT-Pid LABEL "PID_usr"
_CONNECT-Device LABEL "rem_con"
_CONNECT-USR LABEL "usrnum"
_CONNECT-Name LABEL "usrname"
SUBSTRING(_CONNECT-Time,5,6) LABEL "con DATE"
SUBSTRING(_CONNECT-Time,12,8) LABEL "con TIME" WITH 2 COL.
IF _CONNECT-Transid <> 0 THEN DISP _CONNECT-Transid WITH 2 COL.
_CONNECT-Server:BGCOLOR = 14.
. _CONNECT-Transid:FGCOLOR = 2.
END.
END.

Note that in the above code, the "Servers" are simply sorted by their port number, you need to pay attention to which remote servers are in each login broker's
"{-minport,-maxport}" range..