...
Code Block | ||||
---|---|---|---|---|
| ||||
EdmiError edmiTerminateClient(SdaiString password,
SdaiClientId clientId,
SdaiInteger options);
|
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:
Arguments
...
Type | Name | Comment |
SdaiString | Password | The password of the superuser. |
SdaiClientId | ClientId | The client Id of the connection to terminate |
SdaiInteger | Options | One of the options listed below. |
...
Return Value
...
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Options
...
Option | Comment | ||
---|---|---|---|
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 allowed to | completeany complete any succeeding requests will result in the error message edmiE_FORCE_DISCONNECT |
...
Example
...
Code Block | ||
---|---|---|
| ||
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); |
...
. . . |
See also
Filter by label (Content by label) | ||||||
---|---|---|---|---|---|---|
|