Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
themeConfluence
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

...

TypeNameComment
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.
  The returned value will be a pointer to a static buffer in _in  EDMinterface. This buffer may be overwritten by successive_ _successive  EDMinterface_ function calls. Hence, do not release this memory with edmiFree

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.
If the server context specifies TCP or HTTP communication type, this value will be the clientId of the EDMapplicationServer process that executed the operation on my thin EDMclients behalf.
If the server context specifies LOCAL_DB or LOCAL_CONTEXT communication type, this will be the clientId of my own thick EDMclients stateful connection to the EDMserver

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
US:_r_EDMInterface
US:_r_EDMInterface
nopaneltrue

 

Options

...

  

 

Example

...

 

Code Block
languagecpp
/* 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)
showLabelsfalse
showSpacefalse
cqllabel = "model" and parent = "6062220"

 


. . .