C$DISCONNECT

C$DISCONNECT disconnects the executing AcuServer client from the specified server at the time of the call.

Under normal circumstances, the AcuServer client disconnects from the server automatically (without requiring you to call the C$DISCONNECT routine) at shutdown. Also, whenever a server loses its connection to a client, before a new connection is made, all old client connections are automatically closed.

Usage

CALL "C$DISCONNECT" 
    USING SERVER-NAME, PORT-NUMBER
    GIVING STATUS

Parameters

SERVER-NAME PIC X(n)

Contains the name of the server computer from which you are disconnecting. The name will be terminated at the first space character.

PORT-NUMBER PIC 9(n) (optional)  

Specifies the port number of SERVER-NAME. If omitted, this parameter defaults to the value of the configuration variable ACUSERVER-PORT.

STATUS PIC 9(n)

This routine returns the one of the following status codes after the operation has been performed:

0 Client is now disconnected from the server
1 Server/port combination was not found; no such connection
2 Client access is not enabled

Comments

Any open files on the server should be closed before calling this routine. When these files are reopened, it is as if the original connection had never existed. In particular, any passwords needed to connect to the server will need to be reentered by the user.