...
Code Block | ||||
---|---|---|---|---|
| ||||
EdmiError edmiRemoteWhoIsOn(SdaiUnsignedInt serverContextId,
SdaiInteger *numberOfConnections,
SdaiWhoIsOnServer *pWhoIsOn,
SdaiInvocationId *edmiInvocationId)
|
Returns all available information about the thick EDMclients that are connected to a remote EDMdatabase
...
at the point of time for invocation of this function.
...
Arguments
...
Type | Name | Comment |
SdaiUnsignedInt | serverContextId | Context identification, from edmiDefineServerContext |
SdaiInteger | numberOfConnections | A variable that will receive the number of thick EDMclients that are connected to the remote _EDMdatabase{_}.remote EDMdatabase |
SdaiWhoIsOnServer | pWhoIsOn | A variable that will receive a pointer to a tEdmiWhoIsOnServer data structure. See the description of this data structure below. |
SdaiInvocationId | edmiInvocationId | Currently not used. |
The type definition of the tEdmiWhoIsOnServer data structure is done in the sdai.h header file:
typedef struct EDMI_WHO_IS_ON_SERVER {
unsigned int numberOfConnections;
SdaiClientId myClientId;
tEdmiConnection connections[1];
} tEdmiWhoIsOnServer;
Description of the tEdmiWhoIsOnServer struct:
numberOfConnections | The number of thick EDMclients that were connected to a remote EDMdatabase at the point of time when edmiRemoteWhoIsOn function was invoked. This value will also be returned in the functions <numberOfConnections> argument. |
myClientId | The numeric clientId that identifies the connected thick EDMclient that invoked the edmiRemoteWhoIsOn operation. |
connections | A pointer to a buffer of tEdmiConnection data structures. There will be one element for each connected thick EDMclient in the remote EDMdatabase. See the description of this data stucture below. |
The type definition of the tEdmiConnection data structure is done in the sdai.h header file:
typedef struct EDMI_CONNECTION {
unsigned int clientIndex;
SdaiClientId clientId;
InstanceId groupId;
EdmiPackedDate connectionTime;
} tEdmiConnection;
Description of the tEdmiConnection struct:
clientIndex | 1 – max named users. |
clientId | A numeric clientId that identifies the connection of a thick EDMclient in the remote _EDMdatabase_ |
userId | The userId of the EDMuser account that connected to the remote _EDMdatabase._ |
groupId | The groupId of the EDMgroup account that was used by the EDMuser when connecting to the remote _EDMdatabase._ |
connectionTime | The date and point of time at which the EDMuser connected to the actual EDMserver. |
...
Return Value
...
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Options
...
Example
...
Code Block | ||
---|---|---|
| ||
/* Close the model 'MyModel' on all the application servers running on host 'tellus' */ 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 the client ids of all application servers running on host tellus */ 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") ) { |
...
rstat = edmiRemoteCloseModel(suContext, "MyRepository", "MyModel", |
...
"xfx56kl9", connect->clientId, 0, NULL); |
...
} edmiFree(hostName); |
...
edmiFree(clientName); } |
}
See also
Filter by label (Content by label) | ||||||
---|---|---|---|---|---|---|
|
. . .