Versions Compared

Key

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

LMX_ServerFunction sends a message to the license server for processing for a checked out feature. The license server will invoke the specified custom callback function and return a response.

Prototype

Code Block
languagecpp
LMX_STATUS LMX_ServerFunction
(
   LMX_HANDLE LmxHandle,
   const char *szFeatureName,
   char *szMessage
);

Parameters

LmxHandle
[in/out] LM-X handle.

szFeatureName
[in] Feature name.

szMessage
[in/out] The message to send and the response.

Return values

On success, this function returns the status code LMX_SUCCESS.

On failure, this function returns an error code in the format described in Return codes.

Remarks

This function will send a message to the server from which a feature was checked out.

...

In order for this function to succeed, the license server must have a function callback implemented. See lmxserverconf lmx_server_conf.c for details.

Example:

The following example shows a function that could be registered in lmxserverconf lmx_server_conf.c:

Code Block
languagecpp
/* The function parameters should be overwritten by the response back to the client. */
void LMX_CALLBACK ServerFunc(char *szMessage)
{
  char *szTest = "this is a simple response";
  LmxLogprintf("server function called: %s", szMessage);
  
  /* Use the client message in some way ...*/
  ...
  ...
  ...
  /* Prepare response */
  strcpy(szMessage, szTest);
}

...