edmiRemoteStopServer
EdmiError edmiRemoteStopServer(SdaiServerContext serverContextId, SdaiString password, SdaiClientId clientId, SdaiOptions options, SdaiInvocationId *edmiInvocationId);
Terminates a single EDMapplicationServer process, or optionally all EDMapplicationServer processes and the EDMserver, from a thin EDMclient. An EDMserver may not be terminated until all the connected EDMapplicationServer processes have been disconnected. The EDMserver will not accept any new connections from EDMclients will after invoking this function. Terminating an EDMserver will implicitely close the remote EDMdatabase. Once this function is invoked, the EDMapplicationServer process will reject any requests from thin EDMclients. However, by default, any ongoing transaction in the EDMserver, started by the EDMapplicationServer processes will be given the time needed to terminate before the process is disconnected and shut down. Optionally, the EDMapplicationServer process may have its ongoing transaction aborted and rolled back before it is disconnected and stopped. This function is protected by the superuser password.
Arguments
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiString | password | The password of the EDMuser superuser. If the superuser is defined in the server context, this argument is not used. |
SdaiClientId | clientId | The clientId that identifies the EDMapplicationServer process to stop. If the option ALL_SERVERS or ONLY_ALL_APP_SERVERS is used, this parameter will be neglected. |
SdaiOptions | options | See description of available options below. Options may be joined by using the bitwise OR operator |
SdaiInvocationId | edmiInvocationId | Currently not used. |
Return Value
Options
 Â
Option | Comment |
FORCE_TO_TERMINATE | Do not allow time for the EDMapplicationServer process to complete an ongoing transaction before disconnecting it. |
ALL_SERVERS | Stop the EDMserver and all its connected EDMapplicationServer processes. |
ONLY_ALL_APP_SERVERS | Stop the all EDMserver connected EDMapplicationServer processes. |
BY_CLIENTID | |
BY_PORT_NUMBER |
Example
 /* Find and stop all application servers running on the host tellus. Do not allow time for completing ongoing transactions */ int i; EdmiError rstat; SdaiServerContext suContext; tEdmiWhoIsOnServer *pWhoIsOn; tEdmiConnection *connect; SdaiClientId appServer[128], *pAppServer = &appServer[0]; SdaiInteger nConnect, nAppServer; SdaiString hostName, clientName; /* Define Remote Server Context for the superuser */ rstat = edmiDefineServerContext("SuperUserContext", "superuser", NULL, "xfx56kl9", "TCP", "9090", "MyServerHost", NULL, NULL, NULL, NULL, NULL, &suContext); /* Find all connected thick EDMclients */ rstat = edmiRemoteWhoIsOn(suContext, &nConnect, &pWhoIsOn, NULL); connect = pWhoIsOn->connections; nAppServer = 0; for (i=0;i<nConnect;i++) { rstat = edmiRemoteGetClientNames(suContext, connect->clientId, &hostName, &clientName, NULL); if (strstr(clientName, "EDMapplicationServer-") && strstr(clientName, " Main Client") && ! strcmp(hostName, "tellus") ) { /* Stop the EDMapplicationServer process */ rstat = edmiRemoteStopServer(suContext, NULL, connect->clientId, FORCE_TO_TERMINATE, NULL); } edmiFree(hostName); edmiFree(clientName); } . . .
See also
Filter by label
There are no items with the selected labels at this time.