DISCONNECT( ) method (Handle)
- Last Updated: January 18, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Disconnects the client from the application server or Web service currently associated with the specified server handle. For the socket, closes the socket by terminating the connection between the socket and the port to which it is connected.
Return type: LOGICAL
Applies to: Server object handle, Server socket object handle
Syntax
|
When the application server receives a disconnect request:
- For a session-managed application server — Control returns immediately to the client application, and any configured Disconnect procedure executes in the connected application server session.
- For a state-free application server — Any configured Disconnect procedure executes in an available application server session, then control returns to the client application.
- For any application server with pending asynchronous requests— All running or pending asynchronous requests are cancelled and the associated event procedure or method is called for each request. The CANCELLED attribute on the asynchronous request handle for all such cancelled requests is set to TRUE.
If an error occurs during the disconnection from an application server, DISCONNECT( ) returns FALSE. An error occurs if:
- The server handle is invalid.
- The server is either not connected or already disconnected.
If DISCONNECT( ) completes successfully, the CONNECTED( ) method
returns FALSE. In addition, all attributes of the SERVER object (except for the
FIRST PROCEDURE and LAST PROCEDURE attributes) are restored to their initial state.
Specifically, SUBTYPE returns the Unknown value (?).
For sockets, the AVM automatically closes a socket if it detects that the connection to which the socket is bound has failed or been terminated.