Disconnects a client from the EDM Server.
For various reasons, such as system maintenance, it may be necessary to disconnect all clients from an EDM Server. When you try to disconnect a client from the EDM Server, you must give the superuser password.
The client may be terminated in two ways. Either by telling the client to disconnect the next time it sends a request to the EDM Server, or by simply killing the connection and leave it to the client to sort out any problems.
To prevent the clients to reconnect, use edmiSetUnavailable.
Related functions: edmiResetClient, edmiSetUnavailable
Header:
#include "sdai.h"
Prototype:
EdmiError edmiTerminateClient(SdaiString password,
SdaiClientId clientId,
SdaiInteger options);
Arguments:
Password |
The password of the superuser. |
ClientId |
The client Id of the connection to terminate |
Options |
One of the options listed below. |
Options: Descriptions:
KILL_CLIENT |
The client will be inmediately disconnected. Ongoing tasks will be aborted and rolled back. The client will receive the error message edmiE_STOPPED |
FORCE_TO_TERMINATE |
Tell the client to disconnect the next time he sends a request to the EDM Server. Any ongoing tasks will be alloved to completeany succeeding requests will result in the error message edmiE_FORCE_DISCONNECT |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
Example:
EXAMPLE
EdmiError rstat;
SdaiClientId clientId;
SdaiString hostName;
SdaiString s;
SdaiUnsignedInt key;
...
if (rstat = edmiGetClientId("Johnny", &clientId, &hostName)) {
goto error;
}
edmiChangeMyUser("superuser", "", "gZw76Ab", &s, &key);
edmiSetUnavailable("Sorry Johnny!! You're out!");
if (rstat = edmiTerminateClient("gZw76Ab", clientId, KILL_CLIENT)) {
printf("\nError %d in edmiTerminateClient: %s", rstat
edmiGetErrorText(rstat));
goto error;
}
printf("\nKilled johnny@%s", &hostname);
. . .