Disconnects the client from the AppServer 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.
For a state-reset or state-aware AppServer — Control returns immediately to the client application, and any configured Disconnect procedure executes in the connected AppServer agent.
For a stateless AppServer — Any configured Disconnect procedure executes in an available AppServer agent, then control returns to the client application.
For any AppServer with pending asynchronous requests — All running or pending asynchronous requests are cancelled and the corresponding event procedure 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 AppServer, 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 more information on AppServers, see OpenEdge Application Server: Developing AppServer Applications.
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.