Building Distributed
Applications
Using the Progress AppServer


Using the DISCONNECT( ) Method

Using the DISCONNECT( ) method terminates the connection with the specified AppServer by sending a disconnect request to the connected AppServer. When the AppServer receives the disconnect request:

When the disconnection request completes, you can send no more remote requests using the disconnected server handle.

The following example shows how a client application can disconnect from an AppServer instance:

DEFINE VARIABLE hAppSrv AS HANDLE  NO-UNDO.
DEFINE VARIABLE ret     AS LOGICAL NO-UNDO.

CREATE SERVER hAppSrv.
ret = hAppSrv:CONNECT("-AppService inventory -S 5162 -H zeus", 
                    "SMITH", "STARSHIP").
IF NOT ret THEN
  RETURN ERROR "Failed to connect to AppServer".
IF ERROR-STATUS:ERROR THEN DO:
  ret = hAppSrv:DISCONNECT().
  RETURN ERROR RETURN-VALUE.
END.
.
.
.

ret = hAppSrv:DISCONNECT().
DELETE OBJECT hAppSrv. 

When the DISCONNECT( ) method executes, the client application disconnects from the AppServer referenced by the hAppSrv handle.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095