Release 10.1A: OpenEdge Application Server:
Developing AppServer Applications

> ## Disconnecting from a session-managed AppServer

> The following example shows how a client application can disconnect from a session-managed 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 Inventory 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 `hhAppSrv` handle. When the disconnection request completes, you can send no more remote requests using the disconnected server handle.

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