Try OpenEdge Now
skip to main content
Application Migration and Development Guide
Application Development with PAS for OpenEdge : Programming ABL Client Applications : Disconnecting from a PAS for OpenEdge instance : Disconnecting a session-managed client
 
Disconnecting a session-managed client
The following example shows how a session-managed client can disconnect from a PAS for OpenEdge instance:
DEFINE VARIABLE hAppSrv AS HANDLE  NO-UNDO.
DEFINE VARIABLE lReturn AS LOGICAL NO-UNDO.

CREATE SERVER hAppSrv.
lReturn = hAppSrv:CONNECT(" -URL http://slater:OuterLimits64@zeus:8810/inventory/apsv",
                          "SMITH", "StarShip90").
IF NOT lReturn THEN DO:
  DELETE OBJECT hAppSrv NO-ERROR.
  RETURN ERROR "Failed to connect to Inventory on zeus".
END.
IF ERROR-STATUS:ERROR THEN DO:
  lReturn = hAppSrv:DISCONNECT().
  DELETE OBJECT hAppSrv NO-ERROR.
  RETURN ERROR RETURN-VALUE.
END.
. . .
lReturn = hAppSrv:DISCONNECT().
DELETE OBJECT hAppSrv NO-ERROR.
When the DISCONNECT( ) method executes, the client application disconnects from the PAS for OpenEdge instance referenced by the hAppSrv handle. When the disconnection request completes, you can send no more remote requests using the disconnected server handle.